WWDC Day 1 continued

Hello again from San Francisco! I just came back from the conference after attending it for the third day in a row! I have seen many interesting talks so far ranging from Swift to WatchKit and UI design. There is so much to talk about, but in my previous blog entry I could only cover the keynote of the first day. Otherwise it would have been way longer! So let’s continue where I left off …

The State of the Union

This time I want to tell you all about the exciting things that were announced during the talk that came right after the keynote address: “The State of the Union” (well ok there was a lunch arranged by WWDC in between). Like I mentioned in my previous blog post, I like to call this talk “Keynote 2”, because similar exciting things are announced every year during this talk. The main difference with the keynote is that this talk is less marketing oriented and more technical. So let me give you some of the highlights of this talk.

Xcode 7

Xcode 7 beta is released that supports the new Swift 2 and probably has many UI changes that I did not discover yet as of this moment. From Xcode 7 anyone can now natively deploy apps on their devices FOR FREE! Previously you needed to have a €99 developer subscription to be able to do this. Also, they announced from now on you don’t need a separate MacOSX and iOS developer subscription. With a single subscription you now place your apps in the App Stores for both platforms!

The reason for these changes is that they want to make developing for Apple platforms more accessible, especially for students.

iOS 9 binary size

The upgrade binary size for iOS 8 a year ago was a disaster. You needed 4,6Gb of space on your device to be able to download iOS 8. As a result, the adoption of iOS 8 went slower than previous major iOS releases. So this time they did their best to reduce the file size of the upgrade. They managed to make it as small as 1,3Gb this time!!

App Slicing

This is a great new feature of the App Store itself. Previously, an app bundle contained everything that was needed for all different devices that it could possibly run on. It contained:

both the 32-bit and 64-bit compiled code

assets for 1x screens, 2x screens (Retina) and 3x screens (Retina HD)

high and low quality 3D models for games

Now with app slicing, the App Store automatically slices your app binary so it only contains the stuff needed to run on the device that is downloading the app from the App Store. For example an iPhone 6 will only get the “2x” assets and the 64-bit code. This will reduce the file size of each app in the App Store by 20-40% !!

On demand resources

In addition to app slicing, they announced another approach to make the file size of App Store apps even smaller. On demand resources. This means that an app can specify certain resources within the app as being on demand. This makes the App Store take out those resources from the app bundle and host them for you. The app can then download these resources whenever it needs them. This could be really handy for games for example, where each level could be downloaded separately to make the initial app size really small.

Watch OS 2

We already knew from the keynote that Watch OS 2 is here supporting native Apple Watch apps. But now they went into a little more detail, also teasing us to go to other talks that go into even more detail about these topics.

So because the extension with the actual app logic now lives on the watch, no round trips to the iPhone are needed anymore for simple UI logic.

Third party apps can now access to watch’s hardware like the microphone, accelerometer, digital crown and force touch

Third party apps now run standalone

Major speed & responsiveness improvement for third party apps (because of the native app thing)

All kinds of API’s like EventKit, HealthKit, etc use the exact same API on the watch as on iOS. Under the hood it always calls the iPhone to get the data, but for the developer that happens totally transparently

Via a new framework called WatchConnectivity, the watch can kind of directly call http and https URL’s either through the iPhone or when it loses connection with the iPhone: through its WiFi connection to your home network

it’s now possible to create custom ‘complications’ for watch faces!

Mac OSX: System integrity protection

Sometimes apps needed root rights temporarily to install and configure certain things. As a user you notice because it asks you for your password. This made the app able to perform tasks as the admin user. The only problem was, the admin was the root user so it could do anything on the system. “admin != kernel” is how it was presented during this presentation.

This new approach protects system files and processes and does not allow installing files in system locations. In other words, it is now harder (if not impossible) for third party apps to do malicious things on your Mac.

NSPersonNameComponentsFormatter

I thought this one was pretty cool, although it’s a small thing. They added a class in the iOS 9 and Mac OSX 10.11 SDK called NSPersonNameComponentsFormatter. This helps with formatting names of people, since this is different in each country. For example you can ask this formatter to format the name “Tom van Zummeren” for the dutch locale and it will print “Tom”. But when you ask it to print the first name of the chinese name “Ying Ming Lai” it will give you “Ming Lai”. So as a developer you no longer have to worry about these kinds of formatting names.

Split screen and picture-in-picture

Next to split screen mode for iPad, which was already announced at the keynote, iPad apps can also run other apps simultaneously using picture-in-picture. A video for example can be minimized to a small rectangle in the corner of another app with simple gestures. Cool!

iOS 9 iCloud drive app

iOS 9 now includes an app for iCloud Drive! Finally! This was really missing as this only existed on Mac. So you could never get an overview of all the files in your iCloud drive from iOS. Now you can!

Swift 2 specifics

A lot of new Swift language constructs were added, which I think are really great. I will not go into too much detail now, because most of the readers won’t know Swift. But a remarkable addition was the addition of do-catch blocks for error, which are very similar to languages like Java, which have try-catch blocks for exceptions.

Address Sanitizer

With Swift and Objective C you sometimes run into bugs that are related to memory issues. You try to access memory that is no longer there for example. This results in crashes without stack traces and you have no clue what caused the crash. No more! With Address Sanitizer you can make sense of what happened in a very low-level way. You can see exactly what part of the memory the app tried to read and you can see what actually is stored in that piece of memory. If that’s not the data you expected, it gives you clues on what exactly went wrong.

User Interface testing

This is so cool! You can now automate UI testing by writing XCTests that contain code like buttons[“Options”].click(). And the best thing is that you don’t have to write all that code yourself. There is a record option, that lets you record taps in an iOS app and it generates the UI test code for it. All that’s left is to make assertions to check the end result.

UIStackView and Auto Layout

UIStackView is a new component in UIKit which I am really excited about. This solves a problem I wanted to go to a lab for, so I no longer need to. With Auto Layout alone I had to write lots of boiler plate code when I just wanted to layout an arbitrary list of subviews within their parent view horizontally or vertically. In our project we already wrote some supporting framework-like classes to not have that boiler plate code. We can finally throw that away with UIStackView.

Also Auto Layout itself could become very verbose when writing it in code instead of using Storyboard. They introduced a fluent API for Auto Layout that is supposed to make writing that kind of code a lot easier to write (and read!).

In conclusion

The State of the Union talk was almost as exciting for me as the keynote itself. Lots and lots of new things to try out! And because they referenced all kinds of other talks during the coming week, I marked some of them as favourites already so I already know what talks I want to see the rest of the week!

So this finally concludes day 1 of the conference, Monday the 8th of June. The rest of the conference is going WAY more in depth into all of the announced new things. I’ve already seen a lot of very good talks (actually all of them were really really good so far) and I’ve been to a lab which also is quite a unique experience. I will tell you more about those things in coming blogs. Again I can’t predict when I have time to write them, so check back regularly on the Trifork Blog!