I assume you know your way around Xcode and have written a few lines of Swift code before. This book does not offer a tutorial about how to write Swift code, but will show you interesting and powerful iOS apps using Swift. There is a big difference. I dont explain the Swift language in this book, because Apple has already done that quite thoroughly with the Swift Programming Language guide, which is about 500 pages long! There is no need for a book to re-explain what Apple has already explained. So if you are not comfortable with Swift yet, I suggest that you read the aforementioned guide published and made freely available by Applejust do a web search.
Organization of This Book
Here is a concise breakdown of the material each chapter covers:
This chapter explains the fundamental building blocks of iOS development, such as messages, labels, sliders, buttons, text fields and views, navigation bars, etc. I suggest that you read the recipes in this chapter and try them out before moving on to more advanced subjects.
Finally! Apple allows us to extend iOS with these little binaries that ship with our apps, get integrated into iOS, and can live by themselves without the need for our apps to be running in the background. For instance, we can now create custom keyboards that can get installed on the users device and the user can use those keyboards even if our app is not running. This feature has been in Android pretty much since its beginning, so when Apple allowed this feature on iOS, I said not Oh, great but Finally. Have a look at this chapter and make up your own mind about its value for you.
The HealthKit framework allows iOS apps to integrate with the health-information that is stored on the users device. This information belongs to the current user of the device and can contain very detailed information, such as the amount of fat that the user burned in the last running session they did. This chapter teaches you how to integrate your apps with HealthKit and read and write to this health database.
HomeKit is another awesome framework in the SDK. It allows iOS apps to speak to accessories that are HomeKit enabled, so to speak. You will learn to discover these accessories, configure them, talk to them, and so on.
Creating a lively user interface takes more than a table view and a label placed on a navigation bar! You need to simulate real-life physics. This chapter teaches you such things as how to model gravity and other dynamic behaviors, and how to attach those to your UI components.
A lot of the information that we want to display to the user is hierarchichal, in that it can be separated into specific cells on the screen and eventually displayed to the user. Table views and collection views are used pretty much everywhere in iOS. From the Photos app to the Settings, you can see collection and table views at work everywhere. This chapter teaches you all you need to know to create great functionality with these components in the SDK.
When your app runs, by default, you will be on the main thread in your app delegate so that you can perform UI-related tasks. But you do not want to perform heavy downloading tasks and heavy calculations on the UI thread because youll trash your users experience. In fact, iOS will actually kill your app if you block the UI thread for more than five seconds. Concurrency and multithreading is taught in this chapter to allow you to create fluid apps that do all the work they need, without stepping on the UI thread too much.
Do you store usernames and passwords using NSUserDefaults
? If your answer is yes, you desperately need to read this chapter. We will talk about Touch ID authentication and many Keychain-related functionalities. You will also learn how to make your user interfaces more secure.
All the sensors in an iOS device are helpful when you try to find your way to the supermarket or find out which floor of a building you are currently on (seriously, iOS almost always knows this). So you can learn about iBeacons and maps and core location in this chapter.