Xcode 9 发布说明(新特性部分)
Xcode 9 Release Notes
关于Xcode
Accessing Additional Developer Tools
其他开发工具入口
To launch additional developer tools, such as Instruments and FileMerge, launch Xcode-beta and select Xcode > Open Developer Tool. You can keep these additional tools in your Dock for direct access when Xcode isn’t running.
访问其他开发工具,例如Instruments和FileMerge,打开Xcode,选择Xcode > Open Developer Tool。可以将其他工具保留在Dock栏,就可以不打开Xcode时直接访问这些工具。
More Develop Tools
Technical Support and Learning Resources
技术支持和学习资源
Apple provides the following web resources to support your development with Xcode:
苹果提供以下Xcode开发支持:
- Apple Developer Forums. Participate in discussions about developing for Apple platforms and using developer tools.
苹果开发论坛。参与苹果开发平台和开发工具使用的讨论。- Bug Reporter. Report issues, enhancement requests, and feedback to Apple. Provide detailed information, including the system and developer tools version information, and any relevant crash logs or console messages.
提交Bug。向苹果报告问题、改进建议、反馈。提供详细信息,包括系统、开发工具版本信息和相关崩溃日志或控制台消息。- Apple Developer website. Get the latest development information as well as technical documentation for Xcode.
苹果开发者网站。获取最新的开发信息,例如Xcode的技术文档。- Xcode homepage. Get high-level information about the latest release of Xcode. Download current and beta Xcode releases.
Xcode主页。获取Xcode最新发布版的高品质信息。下载当前版本、beta版的Xcode。- For help with using Xcode, use the built-in help by choosing Help > Xcode Help.
choosing Help > Xcode Help打开内置Xcode使用帮助
Deprecations and Removal Notices
冲突和弃用移除注意
- iOS 11 no longer supports armv7 or armv7s (32-bit). If an iOS target has an iOS Deployment Target of 11, then it will not build for 32-bit. iOS targets with an iOS Deployment Target earlier than 11 will still build for 32-bit by default. (32163517)
iOS 11不再支持 armv7或 armv7s (32-bit)。如果一个iOS
target有一个iOS 11 Deployment Target,它将不支持32位。- Xcode Server no longer includes the capacity to host Git repositories. To continue using repositories that were set up in macOS Server, configure a new remote and push your code to that remote. After upgrading to Xcode 9, any existing repositories will be archived in /Library/Developer/XcodeServer/HostedRepositories. (31243129)
Xcode服务器不再包含Git仓库。在macOS服务器建立仓库以继续使用仓库,配置新的远程仓库,并提交代码到远程仓库。更新到Xcode 9之后,任何存在的仓库将打包到/Library/Developer/XcodeServer/HostedRepositories。- Xcode’s Subversion integration will be deprecated in a future release. (33041914)
Xcode的版本管理整合将会被弃用。- The new build system no longer runs shell script build phases with the legacy COMMAND_MODE, which means utility programs, such as echo, will now conform to Version 3 of the Single UNIX Specification. (33875525)
新的编译系统不再用老的COMMAND_MODE命令模式去执行构建阶段shell脚本语句,这意味着例如echo回声等应用程序,现在将符合单一UNIX规范的第3版。
⚠️我的问题:弃用旧的COMMAND_MODE命令模式执行构建阶段shell脚本语句,那么新的COMMAND_MODE命令模式是什么?构建阶段的脚本都有哪些常见的应用呢?
Xcode 9集成开发环境的新特性
General
通用部分
- A file with a base name of FooTest or FooTests is now considered a counterpart of a file with a base name of Foo for navigation and the Assistant Editor. (28981734)
一个文件的名字基于FooTest或FooTests将视作基于Foo对应的导航和助理编辑器。
⚠️我的问题:比如呢?-runFirstLaunch
, a new flag inxcodebuild
interactively checks the status of the license agreement and install any packages required for launching Xcode. (23529342)
-runFirstLaunch
是一个新的动态检查许可协议状态和安装启动Xcode的必须包的标识。
⚠️我的问题:怎么应用呢?- Core NFC can now be enabled via the Capabilities tab in Xcode. (32520707)
Core NFC(近距离无线通讯技术)可以通过Xcode功能选项卡启用。
⚠️我的问题:在哪里应用呢?
Source Editor
源代码编辑器
- You can now increase and decrease the source editor font using Command-plus and Command-minus. (21423189)
可以通过Command-plus和Command-minus放大和缩小编辑器字体。- When text is selected, typing a opening delimiter adds a matching closing delimiter at the end of the selection. Auto-matched delimiters include
" ", ( ), [ ], { }
. (29164633)
选中文本键入(键盘输入)开始分隔符,将在选定的结尾处添加匹配的结尾分隔符。自动匹配分隔符包括“”、()、[ ],{ }
。
The Source Editor’s comment/uncomment functionality now understands that some languages, like Swift, support nesting block comments while others, like the C family languages, do not allow it. This results in more accurate commenting and uncommenting. (32193940)
源代码编辑器的注释/取消注释功能识别一些语言,像Swift,支持嵌套注释块而其他像C语言不支持。这一结果更准确的注释和取消注释。
⚠️翻译、阅读文档好长
Interface Builder
UIView
layout margins now have an option in the Size inspector to enable leading and trailing margins to respect RTL languages at runtime. (30086042)
UIView
布局边距有一个可选的尺寸检查器支持runtime运行时RTL实时语言/解释语言约束leading and trailing
和trailing margins
。- Interface Builder supports the vertical baseline-to-baseline constraints added in iOS 11 that update spacing based on changes in the Dynamic Type size. (30086144)
- Safe Area layout guides can be enabled for any subview and for XIB files. (32956031)
出现兼容性问题解决方案是在xib属性中把Safe Area Layout Guide属性勾去掉。苹果在iOS7中引入的Top layout guide和Bottom layout guide,这些布局指南在iOS 11中被弃用,取而代之的是Safe Area layout guides。当一个viewcontroller 被嵌入到navigationcontroller and tab bar 中时,我们可以使用 Top layout guide和Bottom layout guide 让view根据上下锚点自适应内容。在iOS11中苹果用单独的Safe Area属性代替了上面的属性。安全区域限制于顶部和底部的锚点。- Interface Builder now renders navigation bars, tab bars, and toolbars on the canvas in the same way they appear at runtime. (30983209)
界面生成器现在以与runtime运行时相同的方式呈现画布上的导航栏、选项卡条和工具栏。
To use the newusesAutomaticRowHeights
property ofNSTableView
in Interface Builder, choose “Automatic (Auto Layout)” from the Size inspector and set the Row Height value. The value is used as part of the auto layout calculation. (29511510)
使用界面生成器中的NSTableView新的usesAutomaticRowHeights属性值,从Size inspector尺寸检查器选择“Automatic (Auto Layout)”,并设置Row Heigh值。该值用作自动布局计算的一部分。
Interface Builder now supports setting the estimatedRowHeight of UITableView. This allows self-sizing table cells by setting the estimated height to a value other than zero, and is on by default. (17995201)
界面生成器支持设置UITableView的estimatedRowHeight。这可以通过将估计高度设置为零以外的大小来自动调整表单元格,并且默认情况下是打开的。- Interface Builder no longer compiles for iOS 6. Documents with older deployment targets can still be read, and their frames can be transitioned to iOS 7 and later. (28726486)
- Interface Builder uses
UIView.safeAreaLayoutGuide
as a replacement for the deprecated Top and Bottom layout guides inUIViewController
. To use the new safe area, select Safe Area Layout Guides in the File inspector for the view controller, and then add constraints between your content and the new safe area anchors. This prevents your content from being obscured by top and bottom bars, and by the overscan region on tvOS. Constraints to the safe area are converted to Top and Bottom when deploying to earlier versions of iOS. (29323293)- Interface Builder allows configuring column sizing properties on UISplitViewController. (18359423)
Interface Builder supports settingtextContentType
on classes conforming to theUITextInputTraits
protocol. This improves the ability of AutoFill to populate with appropriate data, including Username and Password on iOS 11. (25019432)
自动填充用户名、密码。
Main Thread Checker
主线程检查器
- Main Thread Checker is a new runtime tool that finds calls to APIs in AppKit, UIKit, and WebKit that must be made from the main thread, but are made on other threads. These calls are reported as runtime issues. Main Thread Checker is automatically enabled during debugging and can be disabled in the Diagnostics tab of the Scheme editor. (29951764)
主线程检查器是一个新的runtime tool
运行时工具,发现调用应该在主线程却在其他线程的AppKit、 UIKit、WebKit的APIs。这些调用将作为runtime issues
运行时异常。主线程检查器在调试过程中自动启用,并且可以在Scheme editor
方案编辑器的Diagnostics tab
“诊断”选项卡中禁用。
Undefined Behavior Sanitizer
未定义行为清除器
- Undefined Behavior Sanitizer is a new runtime tool that finds several types of undefined behavior in C languages, including integer overflows, invalid casts, and alignment violations. It has low overhead and can be enabled in the Diagnostics tab of the Scheme editor. Undefined Behavior Sanitizer is compatible with all other sanitizers. (15425728)
Undefined Behavior Sanitizer
是一个新的runtime tool
运行时工具,用于发现几种C语言undefined behavior
未定义行为,包括整型溢出、invalid casts
、alignment violations
。它的开销很低,可以在方案编辑器的“诊断”选项卡中启用。未定义行为清除器与其他清除器是兼容的。
Undefined Behavior Sanitizer can optionally detect nullability annotation violations at runtime. Go to Build Settings then set “Enable Nullability Annotation Checks” to “Yes” in the Undefined Behavior Sanitizer section. (30619298)
Address Sanitizer
地址清除器
- Address Sanitizer has been extended to check for cases when the scope of a variable has ended, but the underlying memory is used. It also has a new optional check that detects cases where memory backing a local variable is used after the function has returned. This check, for the use of stack memory after return, can be enabled in the Diagnostics tab of the Scheme editor. (32308829)
- Address Sanitizer is now compatible with Malloc Scribble. (32359908)
Thread Sanitizer
线程清除器
- Thread Sanitizer has been extended to catch higher-level races on Objective-C and Swift collections, such as writing to a mutable array from different threads without using proper synchronization. (26798589)
- Thread Sanitizer has been extended to catch when multiple threads call mutating methods on the same struct without synchronization. It will also catch many cross-thread violations of Swift’s rule requiring exclusive access to memory. (30455576)
Asset Catalog
资源管理文件
- Asset catalogs now support named colors, which can be referenced in Interface Builder documents. (28900538)
Asset catalogs
现在支持命名颜色,这可以Interface Builder
页面生成器文档引用。
Asset catalogs now support high-efficiency image formats, including .avci, .heic, and .heif file extensions. (29959599)
Debugging
- iOS devices and Apple TV can now be debugged over the network. For more information, see the topics in Xcode Help > Run and debug > Network debugging. (10968305)
Xcode Help > Run and debug > Network debugging- The View Debugger now supports visual debugging of SpriteKit and SceneKit scenes. SpriteKit nodes are shown in the view hierarchy. For SceneKit scenes, select the SCNScene in the debug navigator to open the snapshot in the SceneKit editor. Changes in the SceneKit editor when it is in runtime debugging mode can be saved and do not change your app. (29169315)
视图调试器现在支持SpriteKit和SceneKit场景可视化调试。SpriteKit节点在视图层次中显示。对于SceneKit场景,在调试导航选择SCNScene
,在SceneKit编辑器打开快照。在运行时调试模式,SceneKit编辑器更改可以保存,并且不会改变app。- Memory graph files exported by Xcode or generated by the leaks command line tool will now save allocation backtraces if malloc stack logging is enabled. This makes the backtraces available for all the tools that support memgraph files (leaks, vmmap, Xcode). (25399716)
Project Navigator
项目导航栏
- Groups in the Project Navigator are now more closely associated with directories in the file system.
- Dragging files between groups in the Project Navigator now moves the files in the filesystem, and updates any associated SCM working copies.
- Creating, renaming, and deleting groups now performs the corresponding changes in the connected directory in the filesystem, if one is defined.
- Removing a group’s connection to a directory in the filesystem can now be done in the file inspector by clicking on the clear (X) button.
- Changing an association to a file or group can be now be done quickly by dragging and dropping the file or folder onto the “Location” section of the file inspector.
(28612132)
Source Control
版本控制
-The Source Control pane in Preferences includes configuring Git and SVN ignore file lists, and for configuring your Git author information. (10544339)
- Xcode 9 integrates with GitHub. You can easily manage your account from the Xcode preferences window, including support for two-factor authentication, and configure an SSH key to be used when performing Source Control operations against GitHub. (28775680)
- Xcode 9 includes a brand new Source Control navigator where you can easily see the working copies for your project or workspace. Each working copy lists branches, tags and remotes, and you can quickly see the currently checked out branch and push/pull counts for those branches. The gear and contextual menus allow you to create branches and tags, configure remotes, and perform tasks like checking out a revision or branch and merging changes between branches. New history and review files editors are displayed when clicking on a branch or tag in the Source Control navigator. You’ll see a full history for your branch or tag, including avatars, author and commit information and each commit is annotated with the branches and tags that correspond to that commit. A new SCM inspector allows you to see more details on a commit and double clicking a commit reveals the Review Files Editor (which shows all the files that were modified as part of a commit and the changes that were made). (29054970)
- Xcode 9 will no longer show repositories that you have cloned source code from in the past in the Preferences/Accounts window. Instead, you can manage your GitHub and GitHub Enterprise accounts. (30191709)
- Xcode 9 includes a brand new Clone... window that integrates directly with GitHub to show you favorite, private/personal and organizational repositories for all of your accounts. For each repository, you’ll see metadata and be able to view the project Readme, and clone with one- click. (30960520)
- Xcode 9 will now automatically fetch from remote tracking branches and mark files that have been updated in the project navigator, and show push/pull counts in the Source Control navigator. (31839384)
- Xcode 9 includes support for one-click clone from GitHub.com in Xcode when viewing repositories in your Web Browser. (32294826)
Localization
国际化
- Export and import of localizations via XLIFF now supports stringsdict files, including support for using the correct plural variants per language. (16785521)
- Xcode no longer exports localizations for test targets, unless they specifically contain localized resources. (16813531)
- Xcode now supports XLIFF export for source files that use encodings other than UTF–8. (18944510)
Signing and Distribution
签名和发布
The distribution workflow has been enhanced to support manual signing. Manual signing allows you to specify the precise set of distribution signing certificates and provisioning profiles that you want to use when distributing your app. xcodebuild -exportArchive also supports manual signing, with new additions to the ExportOptions plist format for specifying a signingStyle, a signingCertificate, and a provisioningProfiles dictionary. See xcodebuild -help for the full list of supported ExportOptions keys.
When automatically signing for distribution, Xcode will now create and use only Xcode- managed distribution provisioning profiles. This behavior is functionally analogous to automatic signing for development, and means that Xcode will no longer create or modify any of your manually created distribution provisioning profiles. Xcode-managed distribution provisioning profiles are supported for all distribution methods except for Developer ID distribution. xcodebuild -exportArchive now fully supports automatic signing, including creating and updating signing assets, if you pass the -allowProvisioningUpdates flag.
In addition, when Xcode detects that you must create a new distribution signing certificate, it will now prompt you for permission to create one and provide you with a convenient means to export the signing certificate for safekeeping or for sharing with other team members. Revoking distribution signing certificates is no longer supported within the distribution workflow. The distribution workflow also no longer requires you to specify a team if your app was signed when you built your archive.
Finally, the distribution workflow now outputs several additional files alongside your exported app: a DistributionSummary plist, a Packaging log, and an ExportOptions plist. The DistributionSummary plist describes the content of your exported app, including information about its signature; whether it inclusion symbols and bitcode; and its embedded content. The Packaging log is akin to a build log, and contains all of the commands used to transform the archived application into a packaged app for distribution. The ExportOptions.plist encapsulates all of the choices you made throughout the distribution workflow. It can be passed to xcodebuild -exportArchive to automate distribution of your app for continuous integration. (29054761)
When Code Coverage is enabled in the Test action of a scheme, Xcode will no longer place the build intermediates and products from the Test action into a separate build location, and will instead use the same location as the Run action. Enabling Code Coverage for the Test action now also enables it for the build performed by the Run action. This causes a build for the Run action to take approximately 3% longer, but allows the Test and Run actions to share build products and intermediates, reducing overall build times when alternating between these actions. (32079317)
When exporting a Swift app for a platform that supports App Thinning, the distribution workflow shows a new option “Strip Swift Symbols” that controls whether Swift symbols should be stripped out of the Swift standard libraries. This significantly reduces the size of the Swift libraries. If the lack of Swift symbols causes problems, such as when using dladdr(), this setting can be disabled. (31669406)
Testing
测试
- When running tests, xcodebuild will no longer launch Simulator. (27385435)
- XCTest includes a new teardown block API for cleaning up test state after your test completes.
(28097197)- XCTest includes a new API that can be used to wait on an XCUIElement existing before proceeding. (28483267)
- XCTest now includes support for targeting multiple applications in a single UI test, including monitoring application state and making a backgrounded application the frontmost application. (28948745)
- XCTest types that are closely associated with a particular class such as XCUIElement.Type are available as nested types in Swift 4. (29000570)
- XCTest includes XCTActivity, a new API for grouping UI test activity together in test reports and logging. (30401267)
- XCTest includes XCTAttachment, a new API for bundling diagnostic test resources such as rich logging along with your test results. (30478677)
- By default, xcodebuild tests on multiple destinations simultaneously. To disable this feature, provide the -disable-concurrent-testing command line argument. (31964004)
- Screenshots captured automatically during UI testing are now saved as images in the JPG format instead of PNG. (32719585)
- XCTest now includes new scheme-level configuration options for disabling automatic screenshots, and new API for capturing screenshots of partial, individual or multiple displays. (21327915)
- UI testing now supports targeting LSUIElements-based applications. (21344280)
- Xcode 9 includes significant improvements to UI testing around performance when targeting applications built and installed by Xcode. XCTest now includes firstMatch for restricting query execution in UI tests. (29544176)(22980005)
- Tests can now be configured to run tests in a specific language and region using a scheme setting in Xcode. (28897796)
Crashes Organizer
崩溃分析
- The Crashes Organizer will symbolicate unsymbolicated logs when selected using local .dSYMs indexed by Spotlight. (22550064)
Templates
模板
- In Xcode 9, the template macro expansion subsystem has been reworked. Improvements include:
- A new standard macro named FILEHEADER has been added that is the content for the standard file header comment.
- Macros can now be defined in terms of other macros. For example the new FILEHEADER macro is defined in terms of macros like FILENAME and COPYRIGHT. COPYRIGHT, in turn is defined in terms of ORGANIZATIONNAME and YEAR.
- Macro expansions can apply modifiers. This was faked in the old implementation by setting special macros that were made by turning other macros into identifiers or xml-safe variants, but now these modifiers can be used with any macro. The syntax is MACRONAME:modifier. Multiple modifiers can be chained like MACRONAME:modifier1,modifier2
- Custom macro definitions and overrides can now be supplied.
For more information, choose Help > Xcode Help and see the topics in Appendixes > Text Macros. (5775785)
Server
服务器
- Xcode Server and xcodebuild now support running tests in parallel on multiple devices and simulators. Bots can be configured to enable or disable parallel testing on devices, and by default bots will prefer to test in parallel. The output produced by xcodebuild when testing in parallel has been updated (any automated tooling relying on this output may need to be updated). (14254639)
- Xcode Server now supports automatic and manual provisioning configurations for your project. For schemes that contain targets that use the automatic signing style, an agent or admin of the developer team can add your server to your team from the updated bot editor. If your scheme requires manually specified certificates or profiles, they can be easily shared with the server from the new Signing tab in the bot editor. (15437174)
- Xcode Server now supports configuring additional arguments that will be passed to xcodebuild when integrations run. (23578597)
- Xcode Server now supports sending an “all clear” email notification when all issues being tracked by a bot have been resolved. (26179348)
- Xcode Server no longer requires the macOS Server app. Configure your server and bots using the Server & Bots tab in Xcode’s Preferences. (28211693)
- Bots can now be configured to run tests in a specific language and region. (30382604)
- Bots now support configuration of an Export Options Plist that will be used when exporting an installable product from an archive. (31895193)
Simulator
模拟器
Simulator now supports face-up and face-down orientations on supported devices. (11393667)
Simulator now respects the system screenshot directory instead of always saving screenshots to the desktop. (26127809)
Simulator can now attach to simulators started from the command line and detach from simulators without shutting them down. To detach when closing a device window or quitting the app, hold down Control. You will be asked whether to shutdown or detach. A checkbox is provided to make whichever behavior you choose the default. To change the default, repeat the same procedure. (31004084)
Simulator now provides a Share Extension. Photos and videos are imported into the device photo library. Locations or pins from Maps.app set the device’s simulated location. App bundles are installed. URLs are opened in Safari. Choose “All Simulators” to install to multiple simulators simultaneously. (31150602)
Simulator now supports edge swipe gestures when the device bezel is visible. Begin your gesture just outside the screen region. (31558767)
The Simulator supports selecting the macOS audio input and output device connected to each simulated device. Use the new Audio Input and Audio Output menus under Hardware. The “System” item tracks the macOS input or output device selected in System Preferences.
To avoid having the Simulator put BT headphones into phone call mode (and decreasing audio quality) select a different input device. (32121469, 32337249) (32337249)
Simulator now supports starting multiple devices simultaneously. As a result the separate “Simulator (Watch).app” has been removed. (5687722)
Simulator shows a device bezel with buttons that send send the appropriate event to the device. (14020158)
Xcode 9.0 supports running multiple concurrent versions of the Xcode app and of any associated tools such as Simulator. Xcode 9.0 can not be run at the same time as earlier versions. (23140937)
Simulator now supports redirecting most keyboard shortcuts to a simulated device. Choose Hardware > Keyboard > Send Menu Keyboard Shortcuts to Device to turn on and off sending keyboard shortcuts to the device. A checkmark indicates that keyboard shortcuts are being redirected to the frontmost simulated device. Each device can have a different setting for this option. In addition, Simulator menus don’t display shortcuts while shortcuts are redirected.
Simulated devices now distinguish between the left and right modifier keys such as Shift, Command, Control, and Option.
System-level shortcuts such as Command-Option-D are not redirected.
Note: Pressing both the Left-Command and the Right-Command keys also turns off sending keyboard shortcuts to a device. (31990219)
The iOS 11, tvOS 11, and watchOS 4 Simulator runtimes now treat the filesystem as case sensitive to better simulate physical device behavior. (18609452)
Build System
编译系统
New Build System
Xcode 9 includes a new build system written from scratch in Swift. It is designed for higher reliability, and it catches project configuration problems which the standard build system does not. The performance of the build system (not including compilers, linkers, and other build tools) has been dramatically improved. This new build system is built on top of the Swift open source llbuild project.In Xcode 9.0, the new build system is disabled by default, but it can be enabled for a project or workspace in the settings accessed with the
Workspace Settings...
orProject Settings...
menu item in the File menu. Passing the-UseNewBuildSystem=YES
flag toxcodebuild
will also force it to use the new build system for a command-line build. The new build system will become the default build system in a future version of Xcode.While the new build system is highly compatible with existing projects, some projects may require changes when adopting it. Expected changes are due to the following:
- The new build system is more strict about detecting and producing an error if a cycle is detected between elements in the build, as cycles can cause unnecessary rebuilds, degrading build performance. To resolve this issue, ensure that all files are produced earlier in the build than when they are used. For example, if a target both produces an output and depends on other targets which use that output, move the production of the output into its own target which can be run earlier in the build.
- It is an error for any individual file in the build to be produced by more than one build command. For example, you may not declare the same output file from two shell script phases in separate targets, if they are both built at once (since the build system has no way to decide which to use). To resolve this, factor out any such tasks into a single target that can be depended upon by anyone requiring it.
- If an output file which is generated by a shell script is used as an input elsewhere in the build (for example, to another shell script), then that output must be declared as an explicit output by the script which generates it; otherwise the build system may attempt to search for the file before it has been generated, causing the build to fail.
- The traditional header map which was generated when the “Always Search User Paths” (ALWAYS_SEARCH_USER_PATHS) setting was YES is not supported by the new build system. Instead, projects should set ALWAYS_SEARCH_USER_PATHS to NO and should migrate to using modern header include syntax:
- Add any needed header files which are in the project repository to the Xcode project, to ensure they are available for use in #include (via the project wide header map).
- Use quote-style include ("foo.h") for project headers, and reserve angle-bracket include (<foo.h>) for system headers.
- The new build system will pass undefined_arch as the value for the ARCH environment variable when running shell script build phases. The value was previously not well defined. Any shell scripts which were depending on this value should instead be written to behave correctly for all defined architectures being built, available via the ARCHS environment variable.
- The new build system does not support the standard “clean” behavior, instead supporting “clean build folder”. (19209225)
- The module.modulemap file that Xcode generates for a target containing Swift and defining a module now includes requires objc so it can be used by languages other than Objective-C (such as C++). (28650820)
- The new “Strip Swift Symbols” (STRIP_SWIFT_SYMBOLS) build setting, which is enabled by default, adjusts the level of symbol stripping so that when the linked product of the build is stripped, all Swift symbols are removed. This significantly reduces the size of Swift frameworks. If the lack of Swift symbols causes problems, such as when using dladdr(), this setting can be disabled. To view the exported symbols from file that has been stripped, use “xcrun dyldinfo - export” instead of nm. (31306055)
- The build setting “Separate Strip” [SEPARATE_STRIP] is no longer displayed in the build settings editor, and it is no longer supported. Xcode always strips binaries in a separate task and no longer instructs the linker to perform the strip. (31584192)
- Schemes with Code Coverage enabled (in the Test action) will now always build with Code Coverage, including for the Run and Launch actions. This reduces the need to build multiple versions of the application. Users who require code coverage to be off for their non-test actions can explicitly use a separate scheme with coverage disabled. (31848014)
- A new build setting for the swift compiler, “Precompile Bridging Header” [SWIFT_PRECOMPILE_BRIDGING_HEADER], has been added. When enabled – which it is by default – this setting adds a new optional step in mixed-source builds called ‘PrecompileSwiftBridgingHeader’, that improves overall build time. If unexpected errors occur during this step, disabling the build setting will omit this step. (31851450)
- There is a new build setting “Swift 3 @objc Inference” [SWIFT_SWIFT3_OBJC_INFERENCE] which controls how the Swift compiler infers @objc for declarations. By default it will use the declared Swift version in the target to perform this inference, but this setting can be used to explicitly direct the Swift compiler to use either Swift 3 to Swift 4 inference rules. (32121595)
- Autocreated schemes are no longer saved to disk unless they’ve been edited. This helps prevent the accumulation of schemes for targets which are deleted, or are added to other schemes. (30266825)
- xcodebuild can now communicate with the Apple developer website to create and update provisioning profiles, signing certificates, and app IDs for targets that use automatic signing. To enable this behavior, first add your Apple ID in Xcode’s Accounts preferences window, and then pass the -allowProvisioningUpdates flag to xcodebuild when building. (27572834)
- Xcode supports a new build setting, CODE_SIGN_STYLE, which can be used to override a target’s signing style to Automatic or Manual when using xcodebuild. (28077832)
Core Data
- When generating code for Swift 4, data model code generation has been updated to use Swift structs when possible. Code generation for Swift 3 is unchanged. (27512827)
- The data model editor presents a unified interface for Core Data’s new fetch indexes feature as well as its existing property index and entity compound index features. Older data models are translated into fetch index form for editing, and saved to the old file format when necessary. Compiling a data model with a Deployment Target lower than iOS 11, watchOS 4, macOS 10.13, or tvOS 11 continues to generate a compatible compiled form. (30843153)
- An attribute in a data model can now be marked as preserved after deletion, to support the Core Data persistent history tracking feature. (31204966)
- An entity can have its Core Spotlight display name expression specified directly in the data model. (31619747)
- The Xcode Core Data model editor supports creating fetch indexes from attributes, expressions, and relationships. (32407895)
- About Xcode 9
- New in Xcode 9 – IDE
- Resolved in Xcode 9 – IDE
- Known Issues in Xcode 9 – IDE
- New in Xcode 9 – Apple LLVM and Swift Compilers
- Resolved in Xcode 9 – Apple LLVM and Swift Compilers
- Known Issues in Xcode 9 – Apple LLVM and Swift Compilers