iOS 9 Swift Programming Cookbook
Solutions and Examples for iOS Apps
Publisher: O'Reilly Media
Final Release Date: December 2015
Pages: 322

All of the example code for this book has been updated on the author's GitHub repository (September 2016).

Ready to build stunning apps for iPhone, iPad, and Apple Watch? This cookbook—completely rewritten with all-new material—provides 90 proven solutions for tackling the latest features in iOS 9 and watchOS 2.0. Written exclusively in Apple’s Swift language, these code-rich recipes show you how to use dynamic user interfaces, interactive maps, multitasking functionality, Apple’s new UI Testing framework, and many other features.

This cookbook is ideal for intermediate and advanced iOS developers looking to work with the newest versions of Apple’s mobile operating systems. Each recipe includes reusable code, available on GitHub, that you can put to work right away.

  • Work with new features in Swift 2, Xcode 7, and Interface Builder
  • Build standalone apps for Apple Watch
  • Create vibrant user interfaces with new UIKit features
  • Use Swift to connect with the iOS contacts database
  • Block ads or obtrusive content with Safari Content Blockers
  • Make your app content searchable with Spotlight APIs
  • Add Picture in Picture playback functionality to iPad apps
  • Take advantage of MapKit and Core Location updates
  • Use Apple’s new UI Testing framework
  • Liven up your UI with gravity and turbulence fields
Table of Contents
Product Details
About the Author
Colophon
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
oreillyiOS 9 Swift Programming Cookbook
 
3.3

(based on 15 reviews)

Ratings Distribution

  • 5 Stars

     

    (5)

  • 4 Stars

     

    (2)

  • 3 Stars

     

    (4)

  • 2 Stars

     

    (0)

  • 1 Stars

     

    (4)

67%

of respondents would recommend this to a friend.

Pros

  • Well-written (9)
  • Helpful examples (8)
  • Accurate (6)
  • Concise (5)
  • Easy to understand (5)

Cons

No Cons

Best Uses

  • Expert (10)
  • Intermediate (9)
  • Student (4)
    • Reviewer Profile:
    • Developer (11)

Reviewed by 15 customers

Displaying reviews 1-10

Back to top

Previous | Next »

(1 of 1 customers found this review helpful)

 
1.0

Not the same as before

By Software app developer

from Sydney, And stralia

About Me Developer

Verified Buyer

Pros

  • Sophisticated
  • Well-written

Cons

  • Difficult to understand
  • Not comprehensive enough

Best Uses

  • Expert

Comments about oreilly iOS 9 Swift Programming Cookbook:

This book has completely been re written from its previous format. The problem with this is that it has lost a lot of the useful code that you would previously expected. I was even looking at the book again the other day trying to think how I could possibly use it in my applications. For being a cookbook, it only gives you one or two useful recipes. Fourth more, those recipes are highly specific to sophisticated uses. I do not think I will be using this book at all, as it has lost a major amount of its previous editions.

(6 of 7 customers found this review helpful)

 
1.0

Poor topic choices

By Lars

from Sweden

About Me Developer

Pros

    Cons

    • Too basic
    • Too many errors

    Best Uses

      Comments about oreilly iOS 9 Swift Programming Cookbook:

      Bad code and poor topic choices are the hallmarks of this book. The writing is good but the code is bad and the book only covers a scattershot of illchosen topics related to iOS.

      (3 of 3 customers found this review helpful)

       
      3.0

      Good but limited

      By GraemeS

      from Thailand

      About Me Developer

      Verified Reviewer

      Pros

      • Easy to understand
      • Helpful examples
      • Well-written

      Cons

      • Not comprehensive enough

      Best Uses

        Comments about oreilly iOS 9 Swift Programming Cookbook:

        As a resource for iOS programming it is helpful and has a style that suits me perfectly. I like being able to learn short snippets of code and to jump around rather than following a long tutorial and hope I remember what I learned later.

        My problem is that it only seems to cover new things, so for the complete cookbook I would also need to get the iOS 8 cookbook, which puts the overall cost way higher than I intended to spend.

        (1 of 2 customers found this review helpful)

         
        5.0

        A must have

        By Sadie P.

        from Milwaukee

        Pros

        • Accurate
        • Concise
        • Easy to understand
        • Helpful examples
        • Was On Promotion
        • Well-written

        Cons

          Best Uses

          • Expert
          • Intermediate
          • Student

          Comments about oreilly iOS 9 Swift Programming Cookbook:

          bought this as a promotion a few weeks ago on Reddit (thanks to the author and O'Reilly) for arranging this.

          Been reading it every now and then. The best use that I have found for this book is this: you have a problem for instance with showing videos on an iOS device, pick up the book, and look for video related recipes until you find what you are looking for.

          one of the best books for swift 2.0 and xcode 7, get it now.

          (0 of 1 customers found this review helpful)

           
          3.0

          Just not that good

          By Jim the Runner

          from San Jose, CA

          About Me Developer

          Pros

          • Lots of examples

          Cons

          • Difficult to understand
          • Incomplete

          Best Uses

          • Expert

          Comments about oreilly iOS 9 Swift Programming Cookbook:

          This book is perfect for an advanced user who just can't quite remember how to do a specific thing.

          For an average user, it is probably more confusing than helpful. Some exercises require a user who is well versed in the XCode interface: for an average user, the author does little as far as explaining how to use the interface, there is significant amount of assumed knowledge (as well as the expectation that the authors shorthand references to the Xcode interface correctly align with the users interpretation).

          Also, some examples do not work as expected, the github repo is incomplete, and still named 'iOS-8'.

          All in all, helpful for really only advanced users.

           
          4.0

          Learn IOS and Swift quickly

          By Carloon

          from Urbana, Illinois - birthplace of HAL

          About Me Developer

          Verified Buyer

          Pros

          • Accurate
          • Concise
          • Easy to understand
          • Helpful examples
          • Well-written

          Cons

            Best Uses

            • Expert
            • Intermediate
            • Novice
            • Student

            Comments about oreilly iOS 9 Swift Programming Cookbook:

            The book provides Swift examples that help a newbie gain access to the IOS API. Given this book, the APPLE example programs, and the Swift manuals an experienced programmer should be good to go. Swift is much easier to program in than OblectiveC.

            (4 of 6 customers found this review helpful)

             
            4.0

            Very new and up-to-date, it could be better (hence 4 stars)

            By Gustaw

            from Krakow, Poland

            Verified Reviewer

            Pros

            • Accurate

            Cons

            • Sometimes Too Advanced

            Best Uses

            • Expert

            Comments about oreilly iOS 9 Swift Programming Cookbook:

            I am reviewing this book in a very early stage and I am not an expert in iOS but I will do my best to explain my experience with this book so far.

            I have read Matt Neuburg's iOS 8 Programming book. I wanted to move on to Swift 2 as I work quite a lot with contacts and the contacts framework on iOS 8 SDK is just a huge headache. I am reading the updates that Apple has made to the contacts framework in iOS 9 in Vandad's book and Apple has really seemed to have sorted out the problem in iOS 9.

            I have so much to say about the book that I think it is best to put my thoughts into each chapter so that I can stay focused?

            Swift 2 and Interface Builder chapter: in this chapter Vandad is laying out what's new in iOS 9 with regards to Swift 2 and Xcode in general. There are tons of stuff that Apple has added to Swift, like the "defer" keyword, the "guard" statement and whatnot. Then there is talk of the "available" keyword that we can now use to find out if a specific API is available on a device or not. So from what I understand in Swift before (please excuse me, I am *not* a seasoned iOS programmer), before this keyword, programmers have to check if a specific method was available on a class or on an instance of that class before calling that method. But it seems like with the "#available" keyword we can now do that a lot easier. Then there is talks about extending existing types in Swift using extensions in Swift. I have a bit of a difficulty understanding this section but from what I understand is that now in Swift we can extend an array of *specific* types? So if an array eg. has integers, then I can extend that array, but not an array that has string objects. This I think is pretty amazing. I digress. The rest of this chapter is about playgrounds, compound switch case statements, and then last but not least about Data Sets in Xcode. So that we can bundle data files into our xcode project easily, and having them in a device specific order.

            Apple Watch: this chapter is quite big. I haven't read the whole thing so I cannot comment on the whole chapter but I will try to write what I have understood so far. The chapter starts with how we can download files with NSURLSession directly on the watch, whichi is new in Watch operating system 2. Then it talks about how we can use the WatchConnectivity framework to understand when the watch is paired and unpaired from the user's iOS device. I can see how this can be useful, for instance, when you need the devices to be fully connected to each other while you do an operation, such as sending sensitive data between the two. So you can now do that with the WCSessionDelegate protocol that is defined apparently in the WatchConnectivity framework. Then this chapter talks about moving NSDictionary instances between the watch and the iOS device. So a lot of transferring data directly from the watch to the iOS device and vice versa which is pretty cool but I don't think I will be using that as much as what the rest of the chapter talks about, which are complications. I have been waiting for complications for a very long time, since the inception of apple watch and they are finally here in iOS 9 SDK. They allow us to put data directly on the user's watch face. So for example I can now show the user's emergency contact information always as a complication on his watch face so that he can tap on it to dial his number. I am guessing. I haven't done that myself yet but I guess it should be possible.

            UI chapter: there is talk of stacked views in this chapter which is a big thing for me. I have been struggling with layout constraints for a long time and stacked views seem to finally solve this issue for me, one way or the other. The idea is that you put your components on your storyboard and then stack them together and then you can assign alignments, content hugging and spacing between the components on the whole stacked view. This is some really good stuff and I am so surprised we have had to wait so long for Apple to implement this. I have personally implemented stacked views in one personal project by reading about them in Vandad's book and I can say that they work perfectly. There is also a section about supporting right-to-left languages but I don't see myself using that section at all. There is one very interesting class that this chapter talks about is RPScreenRecorder that, yes, as you can see, allows you to record your screen and then share the results later.

            Contacts: I have been waiting personally for something like this for a long time. I am very interested in contacts and I have been reading Matt's book for a while on iOS 8 and Apple's frameworks for contacts on iOS 8 is very, well, basic and they are like C APIs. Apple has remedied this it seems like in iOS 9 with the new contacts framework. This chapter talks about creating, deleting, editing contacts and reading contact data, in a formatted manner. There is a recipe that talks about data formatting specifically, for instance, reading the user's name in a localized way. In my language (Polish) a person's middle name is in a way their first name so you can use a class called CNPostalAddressFormatter for instance to read my address in a localized way as well. Very cool stuff.

            Extensions, Web and Search: The extensions chapter talks about one really controvertial subject that Apple has created, and that is content blockers on Safari. We can finally create extensions that run on user's Safari browser that block various content. This is amazing but I can totally see a lot of people getting a bit upset about this. In the web chapter there is a section that talks about a class called CSSearchableItemAttributeSet that allows us to index stuff in our apps now. So let's say that I have an image that the user of my app has "liked" through the app. Now I can index this so that the user can actually search for it in Spotlight on his device and then the item will be deeplinked into my app. Very cool stuff.

            UI Testing, dynamics and other chapters: there are subjects about ui testing which I am not interested in unfortunately and is a chapter that talks about security which I had to use to disable ats, Apple's weird way of forcing all of us to use https. The security chapter has therefore been useful to me.

            I would continue writing but this is my second book review today and my fingers are really hurting. I will end my review with pros and cons of this book:

            pros:
            - updated
            - compilable code, without issues
            - easy to read and understand
            - vast array of subjects covered
            - useful examples everywhere

            cons:
            - since this is a pre-release book, the figures in the book are not very nicely positioned sometimes. They are too big so they block some of the text.
            - the core motion chapter is very short, it could be a bit longer?
            - there are times that I find myself a bit lost as to what to do next. This book is definitely not for beginners.

            I will wait until the book is out and maybe update my review. Recommended book if you want to learn all the cool new stuff in iOS 9.

            (4 of 8 customers found this review helpful)

             
            1.0

            Topic coverage is erratic

            By Pete

            from PA

            About Me Developer

            Verified Reviewer

            Pros

            • It's Ok

            Cons

            • Disorganised
            • Hectic

            Best Uses

              Comments about oreilly iOS 9 Swift Programming Cookbook:

              This book is still in prerelease but seems mostly complete.

              This book is not very good. It does not tell you how to build iPhone applications but instead - in seemingly random order - takes you through a collection of topcis that (I guess?) are of personal interest to the author. Watches to Contacts to Search to UIDynamics and so on. Very disorganised very hectic and hard to learn from.

              I am very suspicious that all the reviews I can see on this page rave about the Watch components of the book. It seems subpar and hasty and doesn't tell me how to do things properly but instead relies on clumsy example code.

              I am also very suspicious that I previously saw a number of reviews expressing similar sentiment to mine but they have since disappeared entirely, lesving only glowing reviews talking about Apple Watches.

              What's going on O'Reilly? Email me if you want to explain.

              (4 of 6 customers found this review helpful)

               
              5.0

              Almost perfect

              By Kristin D.

              from Oslo, Norway

              Verified Reviewer

              Pros

              • Accurate
              • Concise
              • Easy to understand
              • Helpful examples
              • Well-written

              Cons

                Best Uses

                • Expert
                • Intermediate
                • Student

                Comments about oreilly iOS 9 Swift Programming Cookbook:

                Note: my review is from the early version of this book which I believe has not yet gone through production.

                I found the book quite smooth and easy to read. As some of the other reviewers have mentioned, I got attracted to the book mainly because of the Watch OS section that is full of recipes on complications, networking and much more on the watch. There are some location services stuff as well which I have not yet gotten to but I sure will soon.

                I am quite good at Swift 1.2 and I'm currently learning Swift 2 through this book and Apple documentation so I cannot recommend this book only for learning Swift. If you are totally new to Swift, I would suggest that you mix this book with Apple's documentations.

                (2 of 6 customers found this review helpful)

                 
                3.0

                It's OK

                By Jim

                from europe

                About Me Developer

                Pros

                • Well-written

                Cons

                  Best Uses

                  • Intermediate

                  Comments about oreilly iOS 9 Swift Programming Cookbook:

                  This book discusses the things that it covers just fine.

                  But it covers a pretty random collection of topics about iPhone programming.

                  It starts with Apple Watch which is really weird then it moves on user interface, which is better, and then we get to the really useful stuf.. contacts. The rest of the book is a random survey of iOS features going from extensions to making user interfaces with gravity. It's all pretty well covered but it's not coherent or cohesive.

                  And the order that it is covered in is quite odd.

                  If you want to learn how to apply these techniques to an app consider another book.

                  Displaying reviews 1-10

                  Back to top

                  Previous | Next »

                   
                  Buy 2 Get 1 Free Free Shipping Guarantee
                  Buying Options
                  Immediate Access - Go Digital what's this?
                  Ebook:  $38.99
                  Formats:  DAISY, ePub, Mobi, PDF
                  Print & Ebook:  $49.49
                  Print:  $44.99