Andy J, one of my fellow iPhone app developers, wrote a good roundup of the Apple announcement at the start of WWDC 2015 on Monday. This blog will go a bit more in-depth about the iOS bits that caught my attention as Apple released more details throughout the week-long developer conference.
The very first announcement during the Platform State of the Union was that anyone with an Apple ID will be able to download Xcode and run development apps on their devices for free, with no need for an Apple Developer account. From now on, the Apple Developer Program enables users to develop for Apple’s three platforms: iOS, OS X, and watchOS with just one membership, whereas before you were required to register and pay separately for the Mac membership; I can’t wait to develop my first OS X app! More good news on that front is that we can now register up to 100 of each device type for testing and Ad Hoc distribution; that means 100 iPhones, 100 iPads, 100 iPods, etc.
App thinning is used to reduce the footprint of your apps. It has three components: Bitcode, Slicing, and On Demand Resources (ODR). Let’s see what that means for us developers.
When uploading your app to the App Store, instead of the usual binary, an intermediate LLVM representation of your compiled app is sent to Apple. It enables them to apply the latest compiler optimisations without needing a resubmission of the app. This is absolutely automatic, optional for iOS 9 (though strongly recommended) and mandatory for watchOS 2. In order to provide bitcode, all apps and frameworks in the bundle need to include bitcode.
As defined by Apple, slicing is “the process of creating and delivering variants of the app bundle for different target devices. A variant contains only the executable architecture and resources that are needed for the target device.” For instance an app variant for a 32-bit device won’t include the 64-bit implementation; images @3x will only be in the app bundle for iPhone 6+ devices, etc. This process is automatic for architectures (such as 32/64-bit, ARM version) and the usual resources: App Icon, Launch Image, and Image Set. For custom data format, we can opt-in by creating an asset catalog and declaring asset categories.
On Demand Resources
These are resources (images or sounds for instance) that are downloaded when needed and deleted when appropriate i.e. when they are no longer needed or when disk space is low. We can set tags in Xcode for image and data sets. Apple used the example of a game with different levels where resources for each level are tagged for ODR and are loaded as the user progresses through each level. It’s all hosted by Apple and that means an app can have more than 4GB of resources, just not at the same time! It is also important to mention that the App Store slices On Demand Resources too.
These are very exciting improvements that will make apps faster to download and will also use less space on a user's devices.
Spotlight has now been renamed Search in iOS 9 and you can now search inside applications and deep link to the results within an app. This is a very exciting and more than welcome feature to make apps searchable and more discoverable.
Developers choose what to index via the new Search APIs and the results will appear from Spotlight Search as well as from within Safari.
App results even appear when the app is not installed: developers can tag content as public and once a threshold of user engagement is reached for that content, it is made available to Apple’s Cloud Index which then makes it available to all iOS 9 users search results. Search can also index web content.
Here are the three components of Search:
Maintain an app history of what users have consulted in an app and make it searchable using NSUserActivity. This is comparable to a web browser maintaining a web browsing history.
Index content from an app using CoreSpotlight. It is used to index any private content with ability to add and remove content from the index. All built-in apps use it.
Used for apps that mirror their content on a website. Possibility to markup web content with deep links and annotations information. These are used in the Cloud Index.
In addition, iOS 9 introduces Universal Links. Apps can register to open web links (http(s)) directly, bypassing Safari. It uses the same API as Handoff. It provides a seamless experience for users to open a link directly in-app instead of opening in Safari. It’s great added functionality as the link will still open in Safari if a user doesn’t have the app installed. On the other hand, custom URL schemes won’t open anything if you don’t have the app and they are not as secure because anyone can claim your custom scheme and open their app with it. Universal links are integrated on both the website and the app (just like other Handoff functionality) so no one else can use your domain to open their app.
App Transport Security will make sure your iOS 9 apps use a secure data transit by enforcing secure best practices. It requires the use of TLS v1.2 with forward secrecy for an app to communicate over the Internet. That’s how high Apple set the bar for now and they reserve the right to change that requirement in the future as technologies evolve.
As the number of available IPv4 addresses is running very low and will eventually run out within the next few months, Apple has decided to give a boost to the adoption rate by making IPv6 an App Store requirement for any submitted iOS 9 apps. Aware that not every developer has access to an IPv6 connection, they’ve worked on a new feature that turns a Mac into an IPv6 network emulator to test and make sure apps are working with the ‘new’ protocol.
The new Xcode brings a ‘bunch’ of new functionality. First, let’s talk about User Interface Testing. Built on the same foundations as the already available Unit Testing, Apple extended its coverage through UI testing. It uses accessibility elements, just like many other third party UI testing suites. It’s very easy to implement as you can directly record a UI test from Xcode using the simulator. Press the record button and as you go through your app’s user interface Xcode writes human readable test code in real time and in whatever language you use for your test case (Objective-C or Swift). UI Test reports include screenshots for each step performed on the UI.
Now included directly within Xcode is Code Coverage, it indicates the percentage of test coverage for each file and methods. Untested code can be highlighted to easily create new test cases and have source code and tests side by side.
Apple has worked hard to improve the energy consumption of its mobile system iOS. Apple is now passing on the baton to developers with a new debugging tool called the iOS Energy Gauge. It shows CPU usage, calls to networking APIs and location services as well as transition from foreground to background state; it gives insights of how an application behaves and developers can dive into Instruments for details.
Crash Logs of applications submitted to TestFlight and App Store are now directly available in Xcode, from the Organizer window, and link directly to the line of code responsible for an issue so it’s easier to find the cause of a problem and fix it. The functionality is available for iOS and OS X, and will be available soon for watchOS.
Clang Address Sanitizer is a memory detection system for C-based languages. It monitors memory used by an app and detects issues such as buffer overrun. Xcode will help diagnose and debug the problem, and it is “fast enough to be used with all interactive applications”.
With the added ODR and App Slicing abilities, Xcode and Bots (for Continuous Integration) enable developers to debug those by providing Local ODR hosting to stream resources to devices and also an ODR Debug Gauge to see the progress and status of all ODR resources as you request them from a test device.
And everything else…
Unfortunately there are so many new APIs and tools that it is not humanly possible to go through them all. Apologies if you were expecting something about Swift 2.0, Stackview, Multitasking, Storyboard references, Playgrounds, GameKit, and so on. Cheer up, you might read about it in our next blog ??.
Thanks for reading, you may also be interested in our in depth review of WWDC from a Developers perspective
Would you like to talk to us about some of these iOS9 features?
We'd love to hear from you!