What’s New in Xcode 7.3 beta 4

Apple has released the fourth beta of Xcode 7.3 — here’s what’s new and improved in the new version.

Swift Updates

  • New #if swift(>=x.y) syntax for mixing source code for different versions of Swift in the same file. Suggested by David Farler.
#if swift(>=2.2)
print(“Hello!”)
#elseif swift(1.0)
println(“Hello!”)
#else
This code will not parse or emit diagnostics
#endif
  • An Objective-C selector of a Swift method can now be determined directly with a #selector expression. Also — the compiler is now checking the string literals used when constructing a Selector and ensures that they are valid and that there is an @objc method with that selector. The use of string literals as selectors has been deprecated. Suggested by Doug Gregor
let sel = #selector(insertSubview(_:aboveSubview:))
or
let sel = Selector(“insertSubview:aboveSubview:”)
Instead of
let sel: Selector = “insertSubview:aboveSubview:”
  • The typealias keyword is replaced by associatedtype for associated type declarations. The typealias keyword is still allowed in Swift 2.2 but will produce an error in Swift 3. Suggested by Loïc Lecrenier.
  • When referencing a function or initializer you can now provide the complete name. Suggested by Doug Gregor.
let fn = someView.insertSubview(_:aboveSubview:)
instead of
let fn = someView.insertSubview
  • #file, #line, #column, and #function expressions are replacing the existing __FILE__, __LINE__, __COLUMN__, and __FUNCTION__ symbols. The old symbols will still work in Swift 2.2 but will produce an error in Swift 3. Suggested by Erica Sadun.

IDE Updates

  • Address Sanitizer will no longer check for C++ container overflows by default. It is now required to enable it by setting Enable C++ Container Overflow Checks for Address Sanitizer in your target’s build settings to Yes

IDE Fixes

  • Fixed an issue with the navigation button menu on the left side of the jump bar where it would not show anysuperclasses, subclasses, callers, etc.) for a Swift file if there was a unicode character before the cursor position.
  • Improved the workflow for the first time launch of a watch app for a given developer’s certificate.
  • Using xcodebuild build -scheme -sdk with a Simulator SDK will now build instead of displaying an “Unsupported architecture” error.
  • Fixed an issue with running an app signed by a free provisioning team.

Read the full release notes for current known issues and other details.