I assume that you are comfortable writing iOS apps, at least know your way around Xcode, and can work with the simulator. This book is not for beginners. If you have never programmed in Xcode before for iOS, it will be tough to learn iOS programming only from this book. So I suggest that you complement your skills with other online resources. The best market for this book is intermediate and advanced users.
I also assume that you have written a little bit of Swift code. In this book, I use Swift 2 and will teach you some of the concepts, but if you dont know Swift, this is not the right place to start. Please pick up Apples book on Swift programming first; try with that and once you are a bit comfortable with Swift, come back to this book and Im sure youll learn a lot of new things, even about Swift 2.
Organization of This Book
Here Ill explain what each chapter is about so that youll get a feeling for what this book is going to teach you:
In this chapter, we go through a lot of new stuff in Swift, Xcode, and Interface Builder (IB), such as the addition of the
guard
keyword to Swift and conditionally extending types with Swifts new runtime features. Swift has really matured with Swift 2, and I want to share some of the most important additions with you.This years WWDC star, without a doubt, is watchOS 2 with all its additions. Now apps can run natively on the watchOS without having to talk to the iOS counterpart app, and this is great for us. More work, more things to do, more fun. We will talk about complications, transferring files between iOS and watchOS 2 apps, downloading files right on the watch, recording audio, and playing multimedia on your watch.Even though additions to UIKit were not talked about as extensively as watchOS 2 at this years WWDC, there are still tons of new features that we can discuss, including anchored constraints, stack views, and the new Safari view controller.The all-new contacts APIs will be discussed in this chapter. The frameworks on which this chapter is based are both completely new to iOS 9. With the APIs in these frameworks, youll learn how to add new contacts to the users device, remove contacts, edit them, or even allow the user to pick a contact from the list so that you can perform your tasks on it.Safari Content Blockers shocked a lot of developers during this years WWDC. This allows us developers to create apps that get installed as extensions on the users Safari browser, and allows us to block various elements of web pages that the user views. For instance, you can now block pictures or various unwanted elements in the websites that you specify in your app, and you can share these content blockers with those who use your app. This chapter is all about new extension points that you can add to your apps.Apps can now provide content to iOS. iOS will then index these contents and allow the user to search for these contents right within Spotlight on their devices. Your contents can also be indexed globally on Apples servers so even those who dont have your app can see your content on their devices. Intrigued? Read this chapter, then!We now have Picture in Picture (PiP) in iOS. Your app can provide a video player to iOS and allow the user to minimize your whole app into that video player while she works with other apps. Its really cool, in my opinion.With the additions to Core Location and MapKit frameworks, you can now, for example, display an ETA for transit between two locations or display your custom view inside the annotation of a pin on the map.One of the stars of this years WWDC is Apples new UI Testing framework. We can now write native Swift code to do our UI testing, and in this chapter Im going to show you how.Core Motion is now also available on watchOS 2 and in this chapter youll learn some of the new things that you can do with this framework, including reading cadence information from sensors on the device.ATS is a welcome addition in iOS that forces all requests to go through HTTPS. If you build your project with Xcode 7 and iOS 9 SDK, all your network requests will go through HTTPS by default, protecting your content and possibly breaking a few things if you dont support HTTPS in your web services. Read this chapter to learn more.We have some new additions to how apps can interact with Siri and you can read about them in this chapter.Last but not least, there are some amazing effects that you can achieve in your user interface with the new additions to UI Dynamics, including the ability to create turbulence or magnetic fields. In this chapter, Ill show you these additions with examples.