What’s New in Xcode 8.1 GM

Yogev Sitton
3 min readOct 25, 2016

Apple has released Xcode 8.1 GM — here’s what’s new and improved in the new version:

Swift Updates

  • A new macro, __swift__ ,will be defined when importing C and Objective-C code into Swift. The value of this macro will have the form XYYZZ, where X is the major version of the language, YY is the minor
    version of the language, and ZZ is the “patch” version (YY and ZZ are always two digits).
  • Two types have been added to the Swift standard library: UnsafeRawBufferPointer and UnsafeMutableRawBufferPointer. They represent a non-owning view over a fixed region of memory (a buffer). They expose the underlying buffer as a Collection of UInt8 bytes, independent of the type of values held in that memory.
  • A new withUnsafeBytes(of:) function exposes a value’s in-memory representation as an UnsafeRawBufferPointer.
  • Swift standard number types now bridge to Objective-C as NSNumber. Structs for which the NSValue class provides factory methods, now bridge to Objective-C as NSValue. Suggested by Joe Groff.
  • When Optional values are bridged to Objective-C objects, when an Optional is passed to an API that takes nonnull id or when a [T?] array is bridged to an NSArray, the Swift runtime will now bridge the wrapped value if there is one. If a nil value is bridged, and the API does not accept a nil pointer, Swift will use NSNull. Suggested by Joe Groff.

Swift Fixes

  • Swift 3.0.1 now produces a const UnsafePointer instead of UnsafeMutablePointer.
  • The C attribute swift_error(zero_result) is now handled correctly.
  • Access checking for overrides and for members that satisfy protocol requirements has been fixed to more closely match SE-0025. If you need to keep Swift 3 code compatible with Xcode 8.0, use private for top-level classes and structs instead of fileprivate.
  • An issue with `@NSManaged` properties being used to satisfy protocol requirements has been fixed.

Objective-C Updates

  • Objective-C files using Manual Reference Counting now supports __weak references instead of ignoring it. You will need to enable this in the project settings or a compiler warning will be triggered.

Core Data Updates

  • Xcode 8 will now set the same value for entity name and class name when creating a new entity. Changing the entity name will also change the class name, unless they are already different.

Core Data Fixes

  • Changes made to a data model are now available after saving when using automatic code generation.

Interface Builder Updates

  • A new Update Frames button will update the frames of the selected objects and their children.
  • The Pin button has been renamed to Add New Constraints.
  • Custom Gesture Recognizer has been added to the object library to allow subclassing UIGestureRecognizer or NSGestureRecognizer instead of using NSObject.

Interface Builder Fixes

  • Fixed auto layout performance with NSStackView using Gravity Areas distribution.
  • Several issues where Xcode did not always restore view frames from storyboards and xibs when layouts were ambiguous has been fixed. You can now resolve the ambiguity and Xcode will persist.
  • Dragging content into static UITableView cell on the canvas works again.
  • Creating IBAction connections no longer inserts WithSender using Swift 2.3.
  • Selecting Landscape orientation in the Device Bar on non-Retina
    displays when running on OS X 10.11 will now longer hang.

Debugging Fixes

  • Xcode console no longer shows extra logging from system frameworks when debugging in the Simulator.

Simulator Fixes

  • Sticker Pack apps can be used with iPhone 5 and iPad Retina simulators in Xcode.
  • CoreSimulatorService no longer leaks memory each time a device is booted, rotated, or the scale is changed.
  • simctl launch now supports directing the app’s standard out and standard error to file or the local terminal.

Source Editor Fixes

  • Extensions now work more reliably.
  • XCSourceTextRange now includes the character at the start position, and
    excludes the character at the end position. Extensions will need to build against Xcode 8.1 to include the fix.
  • Extensions can check the version of Xcode by comparing XCXcodeKitVersionNumber against the version listed in XcodeKit/XcodeKitDefines.h.

Signing Fixes

  • When manually signing, Xcode requires your provisioning profile to contain all entitlements used by your default build configuration’s entitlements file.

Compiler Fixes

  • Linking LTO files compiled with Xcode 8.1 GM Seed to LTO files compiled with a previous Xcode release will now work even if Objective-C class properties are in use.
  • LLDB properly evaluates Swift expressions when the code contains a “private func ==” definition.

--

--