Book Image

Swift 2 Blueprints

By : Cecil Costa
Book Image

Swift 2 Blueprints

By: Cecil Costa

Overview of this book

In this book, you will work through seven different projects to get you hands-on with developing amazing applications for iOS devices. We start off with a project that teaches you how to build a utility app using Swift. Moving on, we cover the concepts behind developing an entertainment or social networking related application, for example, a small application that helps you to share images, audio, and video files from one device to another. You’ll also be guided through create a city information app with customized table views, a reminder app for the Apple Watch, and a game app using SpriteKit. By the end of this book, you will have the required skillset to develop various types of iOS applications with Swift that can run on different iOS devices. You will also be well versed with complex techniques that can be used to enhance the performance of your applications.
Table of Contents (15 chapters)
Swift 2 Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Displaying weather forecasts


Once the user is happy with the city's information, he/she can also retrieve the weather forecast. As it was already mentioned, the weather forecast is going to be retrieved from Open Weather Map instead of geonames.

We just have to think about how this "scene" is going to work. The idea is to display weather information such as the date and time, the temperature, and an icon of the sun if it is during the day time or a moon when the estimated weather is during the night. If the table view cell needs to display rainy weather, we should use another cell template. This one should display the same information as the other cell, but with an exception that the icon will show rain. We are also going to display additional information on the amount of rain.

Once we have the idea clear, we can start implementing the view controller. Select the ViewControllers group, add a new file called WeatherViewController.swift, and start creating a class with the same name. As we discussed...