WWDC 2017 overview

wwdc-2017A lot has been introduced at the WWDC 2017. Apple introduced iOS 11 with new and powerful features and APIs that allow developers to create apps using machine learning, augmented and virtual reality, accessing music and a lot more. iOS 11 has a strong emphasis on iPad introducing drag and drop, new Dock, file management, and multitasking improvements. Xcode 9 and Swift 4 were also introduced, bringing useful tools to developers.

iOS 11

  • drag & drop – this is the main feature of iOS 11
  • large titles and dynamic types (including custom fonts)
  • file management
  • multitasking using the new floating Dock, slide-over apps, pinned apps, and the new App Switcher
  • password autofill
  • CoreML – provides API to integrate machine learning models into your apps
  • depth – useful for e.g. blurring background with a person in front
  • object classification – recognizing type of object
  • landmark detection

 

Xcode 9

  • refactoring across Swift, ObjC and interface builder
  • wireless debugging
  • fast index with indexing while building – if you worked on large projects you’ll appreciate this very much 🙂
  • new source control editor fully integrated with GitHub
  • built-in Xcode server – no need for MacOs server and Xcode server
  • general updates in performance and build times
  • Undefined Behavior Sanitizer and Main Thread Checker – helps avoiding hard to reproduce bugs
  • run multiple simulators at the same time
  • one compiler for Swift 4 and Swift 3
  • Swift 4 and Swift 3 targets can be compiled together in the same project
  • “fix it” feature – e.g. conforming to the protocol and fix it implements templates of all required methods

 

Swift 4 and Foundation

  • archiving Swift native types with Codable protocol – if a type conforms to Codable protocol and all it’s underlying types also conform to the Codable protocol, Swift handles the rest – works with NSCoding, JSON and Property lists
  • KeyPath type – literal syntax, getters and setters
  • convenient KeyPath literal syntax \BaseType.propertyName; if BaseType can be inferred then \.propertyName
  • optional chaining is going to be available soon: \BaseType.propertyName?.propertyName
  • indirection through subscripts is also going to be available soon: \BaseType.propertyName[0]
  • block based KVO
  • private access modifier now also includes the extensions within the scope of the same source file
  • composition of a class with any number of protocols, e.g. func doSomething(on someObjects: [SomeClass & SomeProtocol])
  • simpler one-sided slicing syntax with indexes: instead of i..<values.endIndex you can use i…
  • multiline string literals – triple quoting syntax
  • where clauses on associated types (I really like seeing this one implemented)
  • generic subscripts
  • enforcing exclusive access to memory – compile time enforcement that allows multiple read operations at the same time, but one and only one write operation at the same time

 

Tests

  • Xcode build launches tests using CoreSimulator instead of launching the Simulator app
  • parallel device testing – build and run once for devices sharing the same platform
  • localization – set language and region for testing
  • async testing improvements
  • multi-app scenarios – interaction with different apps, settings, extensions etc; possibilities to launch or activate different apps when needed during testing
  • UITest capturing screenshots

 

Cocoa Touch

  • Large Title and Search Field
  • Safe Area Insets and Layout Guide to precisely constrain content inside of the content view, taking into account the dynamic height of the new navigation bar that implements large titles
  • new UITableView swipe delete like Mail.app, includes multiple actions on left and right swipes using UIContextualAction and UISwipeActionsConfiguration classes

 

Autolayout

  • scrollview – contentLayoutGuide and frameLayoutGuide
  • frameLayoutGuide – can be used to constrain objects inside of a scrollview so they stay fixed as the the user scrolls

If you get issues with scroll views and insets, you may want to try disabling the iOS 11 content inset adjustment behavior:

 

Safe area

  • part of view that is not occluded by ancestors
  • UIView.safeAreaInsets and UIView.safeAreaLayoutGuide
  • custom container view controllers can update safe area insets to incorporate custom view areas via UIViewController.additionalSafeAreaInsets

 

UITableView

  • table views use self-sizing by default (iOS only)
  • you must ensure all views have sufficient internal constraints or return fixed sizes from delegate methods (you can opt out of this by setting estimated heights to 0)

 

CoreML

  • provides API to integrate machine learning models into your apps
  • models are available from 3rd parties, they need to be translated with Core ML Converter Tools into a CoreML compatible format
  • vision
  • natural language processing

 

ARKit

  • supported on iPhone 6s and above
  • Visual-Inertial Odometry by tracking points in space and fusing that with gyroscope and accelerometer data freeing up CPU, and leaving GPU for rendering objects
  • shadow and light adjustments

 

Localization

  •  pseudolocalization – simulates a localised environment for accented latin, affixed strings and right to left languages (available in Interface Builder preview and Application Language scheme setting)
  • pluralisation with string dictionaries – solves issues for languages with one or more plural variants; a dictionary is used for every language that defines a format and all plural variants and it is included in the XLIFF for translation
  • it’s very easy to export XLIFF for localization – Xcode will read through all source code and resources and generate XLIFF which you can import back into the project after it’s translated

 

Password Autofill

  •  support to autofill passwords saved in iCloud Keychain

 

Asset Catalogs

  • named colors
  • ability to preserve vector data with pdf images to allow image resizing, e.g. tabbar item long press will show a large hud overlay with a big icon and large text of the tabbar item

 

CoreData

  • new indexing API – faster search, multiple indexes, one or more columns per index or one or more indexes per column
  • new attribute types – NSUUID and NSURL
  • integration with Core Spotlight
  • NSPersistentHistory for transactions tracking

 

User Notifications

  • hidden notification content – due to privacy, user defined setting, retrieved using showPreviesSetting
  • thread identifiers and pluralisation with string dictionaries
  • content extension – completely custom user interface – custom title, customize content UI, remove default content on the bottom (you can reuse a view controller from the app)
  • user input customization – media buttons (you provide frame, color and type, you are provided with play and pause actions), actions and custom input views
  • instead of handling actions in the app, it is possible to handle actions in content extension
  • user notifications allow custom input views using UIResponder via standard canBecomeFirstResponder and inputView overrides; custom input views shown via becomeFirstResponder on appropriate actionIdentifier

 

GCD

  • explicit parallelism with DispatchQueue.concurrentPerform
  • DispatchSource – event monitoring primitive, you can use it to handle events on a target queue and handle invalidation
  • target queue hierarchy – serial queues and sources can form a tree – so multiple queues can have their own individual queue order but only one item from all of the queues can execute at one time (shared single mutual exclusion context)

 

Networking

  • URLSession Adaptable Connectivity API with built-in connectivity monitoring – run a request, if offline it will wait and download whenever the resource is available instead of failing

 

App Store

  • complete redesign
  • Games are separated from Apps
  • subtitles, promotional texts and video app previews are added to the app details
  • phased release (only for users with enabled automatic updates since for new users or users that update manually the app update is available immediately) – updates are received over a 7-day period, on first day 1%, second day 2%, then 5%, 10%, 20%, 50%, and on the seventh day 100%

 

TestFlight

  • multiple builds distribution – more than one build available to testers at the same time
  • testing groups – it is possible to organize testers into groups and assign one or more builds to each group
  • internal auto distribution – internal iTunes connect testers get access to all builds
  • individual tester metrics – information on users that are actively testing, users that get the most issues, etc…
  • 2000 tester limit (later this year it will be increased to 10,000 users)

 

I hope you liked this blog post and I’d appreciate if you followed me on Twitter

Related Post

Remember to share...Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInEmail this to someone

Leave a Reply

Your email address will not be published. Required fields are marked *