Field Notes from WWDC: New frameworks & APIs

iOS 7 has a new typography system that lets developers specify font sizes semantically. This gives users the ability to specify fonts sizes that are best suited to their needs while the UI handles changes in text size where appropriate. The new typography system also includes a new framework called TextKit. TextKit allows a developer to layout text, control fonts, add images and even control text flow around UI widgets, which means we no longer need to use UIWebView in order to display sophisticated text layouts.

Because most iOS 7 style widgets no longer have borders, colour plays an important part in conveying information to the user. Views now have a tint property that subviews will inherit. This allows developer to do things like defining a colour theme by setting a tint on a parent view, which will then be applied to all subviews. This is helpful, for example, to visually indicate to the user that a custom control is disabled. Just set the tint colour of the controls top-level view and all of its child views can change colour in response.

Shadows are one of the visual elements that have been removed from iOS 7. Shadows help convey depth in the UI and a lack depth can make it difficult for users to distinguish the boundaries between UI elements. In order to retain the ability to convey depth to the user, iOS 7 uses MotionEffects to make UI widgets “float” in a pseudo 3D space. This was demonstrated during the keynote. Tilting the new home screen showed the app icons floating above the background. What they didn’t show during the keynote was that this system is extended throughout the OS, so even dialog boxes that pop up have this effect as well.

iOS 7 also introduces a new API to give physical properties to widgets. This API, called UIKit Dynamics, allows developers to add things like:

  • Gravity
  • Collision
  • Attachment
  • Snap
  • Forces

And can be customized by adding:

  • Friction
  • Resistance
  • Angular Resistance
  • Elasticity
  • Density
  • Allows rotation

Essentially, it’s a physics engine for your UI and the implications of it are huge. Developers can now create interactive widgets that genuinely mimic real-life behaviour. A demo was shown to developers wherein photos were rendered on a tabletop and they could be dragged around the table with your finger. While dragging the photos across the table, they would automatically rotate depending on where your finger was holding the image. The user could also throw the photo by flicking their finger. As the photo got close to the box a gravity effect was applied so that the photo was attracted to the closest box and would then settle inside. All of that UI behaviour was specified declaratively and did not require the developer to write any gravity, acceleration or rotation rendering algorithms.

iOS 7 also introduces three new multitasking APIs:

  • Background Fetching:  Applications can now ‘wake up’ periodically to check for new updates. What is really interesting about this API is that developers only have to set a minimum time between check (i.e. once a day). The operating system will then monitor the user’s app usage and check periodically for new updates based on how the user uses the app. For example, if I check an app every hour, the app will automatically check for new updates every hour. If I only launch that app once a week, then the minimum period between check will be honored instead (in this case once a day).
  • Remote Notification:  Push notifications from a server can now trigger an application to ‘wake up’ and check for updates. These notifications can happen in complete silence, giving the user no indication that they are happening.
  • Background Transfers:  You can now schedule large data transfers in the background and the new API will automatically handle all networking issues and resume when possible.

Want more information on what iOS 7 will mean for you? Click here to subscribe for updates.


It's only fair to share...
Share on Facebook
Tweet about this on Twitter
Share on LinkedIn