WWDC 2015

What's new in Xcode

On each WWDC, Apple releases a new version of Xcode with a bunch of new features to make it more comprehensive and developer-friendly. In WWDC 2015, Apple introduces the new Xcode 7 coming with the following features:

  1. Playground
  2. App Thinning
  3. Watch OS Support
  4. Instrument Enhancement
  5. Crash Log
  6. Address sanitizer
  7. UI Test

Playground

Playground was first introduced in WWDC 2014. Developer can write pieces of codes (swift only) on it and get response quickly line by line. It is very useful for prototyping and testing. In this year, Playground has new some improvements:

  • Playground can be divided in to several pages, developers present and group their codes nicely
  • Playground's documentation supports Markdown and even creates table of contents and page links. To view markdown, go to Editor > Show Rendered Markup.

    To create page link:

    [Link Display Text](playground-page-name)
    

    Next Page:

    [Next Page](@next)
    

    Previous Page:

    [Previous Page](@previous)
    
  • Playground can render UIView that you can glance over what you do

App Thinning

It helps developers to deliver their app with smaller app size and let users download the on-demand content when they need. There are 3 ways to do so:

  • Bitcode: Xcode will process your binary automatically by this technique. Thus, Apple own a set of processed code which allow her to generate new app with their updated compiler or architecture in future. And developer can get rid of app re-submission, Apple do it for you.

  • App Slicing: Your app is sliced in to pieces by architecture, image sets, etc. Slicing process is automatically done by Apple after your app submission. All you need to do is put all your assets into image assets. Apple engineers say that XCAsset now supports other formats, e.g. plists, 3d modes, etc.

  • On Demand Resource: By tagging your assets in XCAsset, you can slicing them out of your main bundle. These bundles are hosted by Apple. You make a bundle request when those on demand resources are going to be shown or required.

    Reference: [link]

    code block

Watch OS Support

This year, Apple puts much more effort on Apple Watch. WatchKit is separated out and become Watch OS. Xcode 7 provides an auto-migration tool for migrating from old WatchKit to Watch OS codes.

Instrument Enhancement

  • add energy efficency profiler
  • add location request profiler

Crash Log

  • In Xcode's organizer, a new session is about Crash Log, which is something simular to (clone?) Google Play Exception Logger or Crashlytics. You can check the crash report from testflight users to app store users. It includes crash device models, OS versions, crash frequency and even crashed source code position. So, developers can target the crash issue much accurately.

Address sanitizer

AddressSanitizer (or ASan) is a programming tool that detects memory corruption bugs such as buffer overflows or accesses to a dangling pointer (use-after-free).

Developers always face with EXC_BAD_ACCESS crash that Xcode point back to main() function. Developers can't trace back what functions get called before. With ASan, it helps you trace back where the memory corruption is.

UI Test

UI Test is supported in Xcode 7 seamlessly (before you need UIAutomation or Snapshot plugin). Developers simply start a UI recording session which convert all user interaction as UI testing script. Moreover, developers can insert some testing script to test the availability of UI elements and its correctness.