What’s new in Xcode 11
What’s new in Xcode 11
Xcode 11 includes SDKs for iOS 13, macOS 10.15, watchOS 6, and tvOS 13. Xcode 11 supports on-device debugging for iOS 8 and later, tvOS 9 and later, and watchOS 2 and later. Xcode 11 requires a Mac running macOS 10.14.3 or later.
- Xcode 11 beta supports development with SwiftUI.
-
Xcode supports uploading apps from the Organizer window or
from the command line with
xcodebuild
orxcrun altool
. Application Loader is no longer included with Xcode. - LaunchServices on macOS now respects the selected Xcode when launching Instruments, Simulator, and other developer tools embedded within Xcode.
- Assets can now be cut, copied, pasted, and duplicated using the menu or keyboard shortcuts.
-
Projects may now use custom build rules to process header
files (
APPLY_RULES_IN_COPY_HEADERS
) - Editors can be added to any window without needing the Assistant Editor. Editors are added using the “Add Editor” button in the jump bar or the File > New > Editor command. Each editor can now be in one of three modes: “Editor Only”, “Editor and Assistant” or “Editor and Canvas”. The latter two modes automatically show relevant content when available. When using multiple editors, the View > Editor > Focus command can be used to temporarily expand the active editor to fill the entire window, hiding other editors. For source control support, the Code Review button in the Toolbar replaces the Comparison Editor. The “Show Authors” command is now available from the Source Editor’s Editor menu. The SCM Log is now in the Inspector Area.
-
In Core data , There is now a checkbox that makes it possible
for you to distinguish whether the default value of a string
attribute should be
nil
or the empty string. When set, the default value is the empty string if no other default is specified. - In Core data ,The Xcode 11 data model file format no longer writes out or preserves deprecated Sync Services information for entities or properties.
- When creating an application using Core Data, there is a new checkbox to also enable CloudKit support for the data model’s default configuration. This can also be enabled for an existing data model using the new configuration inspector.
- Interface Builder’s device bar lets you switch between the light and dark appearance for iOS apps.
-
The contents of a
UIScrollView
are scrollable within the canvas, once its subviews are fully constrained with Auto Layout constraints. - You can now localize assets in asset catalogs. Localization is enabled in the attribute inspector.
- In Organizer, The new Metrics organizer shows battery life and performance analytics for your app to help you drive optimizations.The available metrics are battery drain, launch time, hang rate, memory, and disk writes.
- Signing and capabilities settings are now combined within a new Signing & Capabilities tab in the Project Editor. The new tab enables using different app capabilities across multiple build configurations. The new capabilities library makes it possible to search for available capabilities.
- Xcode no longer creates every available iOS simulator device by default. Instead a set of the most commonly used devices are created. To create other devices — or multiple instances of a device — open the Devices window, select Simulators, click the + button, enter a name, and select the relevant device type and OS version.
- In Source Control, You can now cherry-pick changes from one branch to another.
-
// MARK:
comments and#pragma mark
directives now draw a separator line in the editor. The preference for showing mark separators is in Preferences > Text Editing > Display > Show Mark Separators.
What’s new in swift with Xcode 11
- The memberwise initializer for structures now provides default values for variables that hold default expressions. (SE-0242)
2. An
@autoclosure
parameter can now be declared using a type alias. (SR-2688)
3. Methods declared using the
@objc
attribute
inside a class can now return
Self
. (SR-7601)
4. Conversions between tuple types are now fully implemented. Previously, the following would diagnose an error. (SR-2672)
5. You can now declare and use type subscripts, just like type
properties and type methods. Declare one by applying the
static
or, in
classes,
class
modifier
to the subscript declaration. (SE-0254)
Type subscripts can also be used with dynamic member lookup to create dynamic type properties.
6. Assigning
Optional.none
to an enumeration that also has a
none
case, or
comparing such an enumeration with
Optional.none
now produces a warning. Such expressions create an ambiguity
because the compiler chooses
Optional.none
over the
none
case
defined by your own enumeration. (SR-2176)
The compiler provides a warning along with a fix-it to replace
.none
with
Optional.none
or Foo.none
to
resolve the ambiguity.
7. Functions can now hide their concrete return type by declaring what protocols it conforms to, instead of specifying the exact return type:
Code that calls the function can use the interface of the protocol, but doesn’t have visibility into the underlying type. (SE-0244)
8. Enum cases can now be matched against an optional enum without requiring a ‘?’ at the end of the pattern. (SR-7799)
9. You can now use the
Self
expression
to refer to the innermost nominal type inside structure,
enumeration and class declarations. For example, the two method
declarations inside this structure are equivalent:
In classes,
Self
is the
dynamic type of the
self
value, as
before. Existing restrictions on
Self
in
declaration types still apply; that is,
Self
can only
appear as the return type of a method. However,
Self
can now be
used inside the body of a method without limitation. (SE-0068)