The App Developers Guide to Winning Ios 8
Total Page:16
File Type:pdf, Size:1020Kb
THE APP DEVELOPERS GUIDE TO WINNING IOS 8 BY DAN ROWINSKI 01 INTRODUCTION BIG SPLASH pple kicked off the Mobile Revolution in 2007. At the time, Microsoft CEO Satya Nadella has styled the Mobile A the iPhone was a curiosity, lampooned by some, praised by Revolution as, “ubiquitous computing and ambient others. In seven years, it has proven to be the most important intelligence,” as a means of describing the spread of driver of technological industry growth since the inception of the smartphones everywhere connected to the Internet and World Wide Web. the cloud. The notion of ubiquitous computing doesn’t just stop with the smartphone, even if that is where it started. In the process, Apple has made a household name out of the The Mobile Revolution has pushed the bounds of hardware operating system for the iPhone: iOS. and software as developers, manufacturers and engineers have built systems that are smaller and more powerful to It is hard to imagine now that now that iOS is part of the popular increase the capabilities of these pocket-based computers. lexicon, but it originally did not have a dedicated name. When the first iPhone was released in July 2007, Apple just said that it ran a The PC shrunk to fit into a phone. With that accomplished, version of Apple’s desktop operating system, Mac OS X. In 2008, all those small and powerful components in the phone are Apple started calling it “iPhone OS” (which subsequently led to the ready to explode like a supernova, invading every gadget debut of the Apple App Store). It wasn’t until the fourth iteration in that we touch: our cars, our homes, our watches, our 2010 that Apple renamed the operating system to the iconic iOS. televisions … everything. Here we are, the autumn of 2014, ready to dive into iOS 8. We worked so hard to get the technology to fit in one device. Might as well use it in all devices. Wrap your mind around the notion of the Mobile Revolution, because it informs everything about iOS 8. Apple fundamentally BIG SPLASH This is the essence of iOS 8, leading us into the Second changed the computing paradigm with the iPhone, imagining a Phase of the Mobile Revolution. world where a powerful computer was in everybody’s pocket, connected to the Internet and easy to use. THE APP DEVELOPERS GUIDE TO WINNING IOS 8 02 WHAT’S NEW WHAT’S NEW IN IOS 8? Apple has said that iOS 8 is the biggest release of iOS ever. It has more than 4,000 application programming interfaces for developers to play with and a variety of new standards and frameworks in which to develop iOS apps. Since it was announced at Apple’s World Wide Developer Conference in June, iOS 8 has flown a bit under the radar. iOS 8 does not have the hype of its predecessor iOS 7, where the beta release that was meant solely for developers but saw broad downloads by millions of people because it fundamentally changed the design and functionality of the operating system from previous versions. This time around, no major design or user interface changes are coming to iOS 8. The iOS 8 beta period was truly a developer release, giving iOS app builders the summer to adapt to the new operating system before it goes public after the launch of the iPhone 6. Apple added a variety of new tools to iOS 8. It wants to invade home automation with HomeKit. Your health and fitness now have a new repository for data in HealthKit and the iOS Health app (not to mention the Apple Watch, coming in early 2015). Photo storage is improving with PhotoKit and Apple has done some big things on the backend of the entire system with iCloud and CloudKit. The biggest and most immediate concerns for developers come in the form of App Extensions that provide interoperability between apps, Handoff (Continuity) that shares content between Apple devices and Adaptive Layout, which will help iOS developers build apps for the new variety of Apple screen sizes. THE APP DEVELOPERS GUIDE TO WINNING IOS 8 03 WHAT’S NEW XCODE 6: GETTING STARTED WITH IOS 8 •• If you are reading this ebook, we presume that you know a thing or two about iOS. To develop iOS 8 apps you will need Xcode 6, which was released as a Gold Master version ahead of the official public release of iOS 8 on September 17th. Xcode 6 includes all the libraries and frameworks needed for both iOS and Mac OS X development and includes the iOS Simulator and the Xcode integrated developer environment. Here are some highlights of Xcode 6 that developers will need to become familiar with: • NEW SWIFT PROGRAMMING LANGUAGE: • TESTING: Xcode 6 lets developers use performance Apple released a new programming measurement and asynchronous code testing language that it hopes will eventually through an enhanced XCTest framework. replace both C and Objective-C • INTERFACE BUILDER: The iOS family now has a large languages for future iOS development. variety of screen sizes. The new Interface Builder in Xcode 6 provides a playground for Xcode 6 helps developers build apps that will work developers to learn the language and across a range of screens and includes live rendering, make it as easy as possible to learn, support for size classes and custom iOS fonts. More build and debug. Xcode documentation on this in the Adaptive Layout section below. shows helpful hints and libraries for when to employ Swift or Objective-C among other helpful features to get started with Swift. THE APP DEVELOPERS GUIDE TO WINNING IOS 8 04 WHAT’S NEW • DEBUGGING: Several new debugging tools are in Xcode • GAME DEVELOPMENT: Both of Apple’s primary 6, including a “view debugging” function for debugging game development frameworks have been visual and design problems. The queue debugging has been upgraded in iOS 8 including SceneKit and enhanced with a new bug navigator. Debug gauges provide SpriteKit and have new support in Xcode 6. “at-a-glance” information about resources while debugging • HOMEKIT ACCESSORY SIMULATOR: If you and includes three new gauges for network activity, file are developing for the smart home with activity and iCloud. iOS 8, Xcode 6 has a simulator to test on • IOS SIMULATOR: The new iOS Simulator has configurations accessories like lights or appliances. to keep data and configuration settings together. The Xcode Server, instruments, app compiler and localization features also have new features and enhancements. Make sure to take an in-depth look at what is new in Xcode 6 as you get started with iOS 8 development. THE APP DEVELOPERS GUIDE TO WINNING IOS 8 05 DEVELOPMENT WHAT YOU NEED TO KNOW TO DEVELOP FOR IOS 8 Let’s break down just about everything and functionality of each of those apps, you would have to that you are going to need to know manually switch from one to the other, like jumping from one to get started with iOS 8. square to another in hopscotch. The individual app—and its limited functions—has long been the king of iOS. Note: Gaming is a huge part of the app economy and iOS 8 development. Apple has improved Android has never had this particular problem. Since its its gaming frameworks and engines with SceneKit, inception, Android has always allowed developers to share SpriteKit and Metal for both casual and hardcore game functionality and data between apps. The system is called development. This book will not cover the gaming Android Intents and nearly 90% of apps in the Google Play aspects of iOS 8 as they are a separate topic that we will store employ it to one degree or another. Intents allows apps to tackle in the near future. employ third-party (not system-level) keyboards, embed social sharing or play music from a wholly different app. Because This book also not cover Swift, Apple’s new programming of Intents, Android has long been the more egalitarian app language, as it is not specifically pertinent to what is developer environment, making it easier to share properties new in iOS 8 and a large topic that we will cover in between apps. depth soon. Apple has finally awoken up to this subtle but important APP EXTENSIONS •• In iOS, apps have long been treated difference of iOS to Android and is set to remedy it in iOS 8. as individual silos. You have one app for email, one app Dubbed “App Extensions,” iOS 8 apps are about to get a lot for sports scores, one app for music. To access the data more integrated with each other and the operating system. THE APP DEVELOPERS GUIDE TO WINNING IOS 8 06 DEVELOPMENT EXTENSION POINTS •• Both iOS and Mac OS X have Seven different types of app extensions exist within iOS and a variety of different kinds of App Extensions. Mac OS X: Each of these extensions is connected to an aspect •TODAY: An update or task in the Today section of the drop of the operating system. According to Apple’s down Notification Center. documentation, each “system area that supports • SHARE: Share content with other apps or to a website. extensions is called an extension point. Each extension point defines usage policies and provides • ACTION: View or employ content within another app. APIs that you use when you create an extension for •PHOTO EDITING: Edit a photo or a video in the native iOS that area.” Photos application (iOS only). •FINDER: Show information about file synchronization in the When building applications for iOS 8, it will be Finder (Mac OS X only).