Unlimited Plugins, WordPress themes, videos & courses! Unlimited asset downloads! From $16.50/m

Next lesson playing in 5 seconds

Cancel

Free Preview: Go Further With Swift: Animation, Networking, and Custom Controls

Introduction

01:39
  • Overview
  • Transcript

If you've already learned the basics of iOS app programming, you're ready to go a step further and tackle some more advanced topics. App store customers expect animated, engaging apps with clear feedback on UI events. They want apps that connect to the web to get relevant, up-to-date information. And they want apps that stand out with unique custom interfaces.

In this course, you'll learn some advanced skills for building professional-quality iOS apps. Follow along with Markus Mühlberger as he codes a functional iOS weather app with live weather data, custom UI components, and some slick animations to bring everything to life.

We've built a complete guide to help you learn Swift, whether you're just getting started with the basics or you want to explore more advanced topics: Learn Swift.

1. Introduction

1.1 Introduction

The iOS platform contains some very powerful frameworks by Apple. Their purpose varies. But some of them are extremely important to create a great and selling app. Hello and welcome to this Tuts+ course. My name is Markus Muhlberger and you are watching Go Further with Swift, where we build a weather app for iOS. This course is split into three parts. In the first one, we're going to look at animations in iOS. Those can make your app up and provisionally interesting to your users. We are going to look at view and layer animations and also techniques to time and group your animations. The second part is all about networking. We're using NSURLSession to create a simple API client for our weather API from scratch. You're going to learn about the different parts of a network request and how to make it efficient and concurrent. In the last part we are tackling custom controls because the default the UI kit ones only get you so far. To get started I'm going to show you how to create a composite control of UI kit components, then how to create layer based controls to display completely custom elements. And finally how to use Core Graphics to interactively let the user draw on the screen. If you want to raise your app development skills to the next level, I will see you in the first lesson.

1.2 Project Overview

Hi, and welcome back to Go Further with Swift where we build weather app for iOS. In this lesson, I'm going to give you a tour of the finished project and show you the code and the cause repository. All animations are running after the app start, so I'm going to launch it right now. You can see a lot is happening at once. The city name flies from the top, temperature from the bottom and after a little delay, the weather icon appears. The first one is done with view animation. The later ones are layer based animations. You can see that because a little compass is not behaving correctly and is interacting with the city label. All the data is fetched over the network using the open weather map API every time the location updates. Let me change to the location real quick to show you what I mean. There are also custom controls, some hidden, like the weather condition. This is a composite view of two UI kit elements, an image view and a label. There is also a very obvious one which displays the event data in a little compass-like view. This is done with custom layers. Finally, to show you how to use core graphics, I added a canvas where you can draw with your mouse or finger. When looking at the source code, you will have to view controller as the main component of this application. It will contain the animation code and also the callbacks for handling network request, which sets the data under UI components. It uses call location to get the user's coordinates to send to the API. This API is fetched in a separate class that handles all network requests. For our custom controls, I've created three different classes, one for each lesson. You can also look at the storyboard to see it. Unfortunately, Condition View has some problems with auto layout constraints in the storyboard editor. Sometimes this happens. The Wind Direction View is drawn correctly however. And you can also change to preset wind direction in the editor and the view updates. Finally, there is the canvas, which contains a very simple implementation, although the concepts behind it are quite advanced. As always, I create a separate commit for each lesson and also tag the commits with the lesson number. So you can easily find the result of each one. In the next lesson, I'm going to create the Xcode project and basic user interface that we want to use in our app. See you there.