Apple Swift 5.0 (swiftlang-1001.0.45.7 clang-1001.0.37.7)
Target: x86_64-apple-darwin18.2.0
ABI version: 0.6
Swift apps no longer include the DLL for the Swift standard library and the Swift SDK overlay in versions for iOS 12.2, watchOS 5.2 and tvOS 12.2. As a result, Swift applications are reduced in size when deployed for testing in TestFlight or when compressing an archive for a distribution.ABI is finally going to be stable, and this is great news. In my opinion, today this is one of the key problems of Swift - not because of side effects, but because of unfulfilled promises. Some of my friends even rewrite extensions for Apple Watch on Objective-C to reduce the size of a binary file (from about 15 MB to 1 MB). To learn more about the state of ABI, please use the following links: Swift ABI Dashboard and Swift ABI Stability Manifesto .
The @dynamicCallable attribute allows you to call named types as well as functions using simple syntactic sugar. The main purpose is to ensure compatibility with dynamic languages. ( SE-0216 )
@dynamicCallable struct ToyCallable { func dynamicallyCall(withArguments: [Int]) {} func dynamicallyCall(withKeywordArguments: KeyValuePairs<String, Int>) {} } let x = ToyCallable() x(1, 2, 3) // Desugars to `x.dynamicallyCall(withArguments: [1, 2, 3])` x(label: 1, 2) // Desugars to `x.dynamicallyCall(withKeywordArguments: ["label": 1, "": 2])
Swift 3 compatibility mode is excluded. Supported values for the -swift-version
flag are 4, 4.2, and 5.
In Swift 5 mode, switch statements on enumerations declared in Objective-C or coming from system frameworks must process unknown values — that is, those that may be added in the future or that can be defined separately in the Objective-C implementation file.
Formally, Objective-C allows any value to be included in an enumeration if it corresponds to the base type. These unknown cases can be processed using the new case of@unknown default
, which still issues a warning if any known cases in the switch are missing. They can be controlled using the normaldefault
. If you specify an enumeration in Objective-C and do not want clients to have to handle unknown values, use theNS_CLOSED_ENUM
macro instead ofNS_ENUM
. The Swift compiler recognizes it and does not require setting thedefault
in a switch statement.
In Swift 4 and 4.2 modes, you can also use the@unknown default
. If you do not do this and skip the unknown value in the switch, the program will be interrupted - just as it was in Swift 4.2 and Xcode 10.1 ( SE-0192 )
default
switches. I remember how much agony the .provisional
option in the UNAuthorizationOptions
type appeared in iOS 12. Now, with the introduction of case'and unknown
, to cope with such situations has become much easier.Now packages can choose the minimum required version for the Apple platform (macOS, iOS) when using the Package.swift configuration file from Swift 5. Building a package is not possible if at least one of the dependencies the minimum platform version is greater than the version specified for the package itself. ( SE-0236 )
dyld: Library not loaded
on startup, giving the error dyld: Library not loaded
SWIFT_FORCE_STATIC_LINK_STDLIB=YES
.@objc
method cause you inconvenience.
- A new diagnostic identifies framework headers that use inclusions with quotes instead of framework-style inclusions. By default, the alert is turned off, but you can turn it on by passing the
clang
-Wquoted-include-in-framework-header
option;- open framework headers can erroneously perform
#import
or#include
private headers, which leads to disruption of the structure, and sometimes to the cyclic import of modules. About such violations will report a new diagnosis. It is disabled by default inclang
and is controlled by the-Wframework-include-private-from-public
flag;- Using
@import
in framework headers does not allow using them without modules. New diagnostics seeks out@import
in the headers when passing the—fmodules
flag. By default, it is disabled and controlled by the-Watimport-in-framework-header
flag;- Previously, the loss of the
framework
keyword when declaring a module for a framework did not interfere with the compilation, but silently led to an incorrect result. New diagnostics--Wincomplete-framework-module-declaration
and a new fix will prompt you to add the required key. This warning is triggered automatically by passing the—fmodules
clang
flag.
The search for implicit dependencies now works in the “other linker flags” section of related frameworks and libraries marked -framework, -weak_framework, -reexport_framework, -lazy_framework, -weak-l, -reexport-l, -lazy-l или —l.
.xcconfig
or even xcodebuild
, avoiding the Link / Embed stages in Xcode itself.UIStackView
propertiesUIStackView
now displayed in the visual debugger inspector. The visual debugger has a more compact three-dimensional view.
Now, if an error occurs due to insufficient memory, Xcode can automatically create a graph of memory usage. You can enable the creation of graphs in the diagnostics window in the schematic execution settings
When approaching the limit of memory usage in iOS and watchOS Xcode displays the limit in the memory usage report.
applicationDidReceiveMemoryWarning
. I thought that the update would be more useful, but for now it's just a little plus.
- Now you can use $ 0, $ 1, and other abbreviations when calculating expressions inside closures.
- LLDB now has a new alias,
v
for the frame variable command, which serves to output variables in the current frame stack. Since it does not use the expression evaluation tool,v
can be much faster thanp
orpo
, and therefore preferable.
v
provides the best output — but it is not a direct replacement for po
and only works with the current frame stack with certain restrictions. Examples:Playgrounds may not start
Siri does not work in watchOS and iOS simulators.
Pasteboard synchronization between macOS and simulated iOS devices has become more reliable.
The request to access the microphone on all simulated devices will not be repeated.
xccov
supports combining several code coverage reports (and associated archives) into one general report and archive. The resulting report may contain inaccuracies, since there may be changes in the source files between the time the reports are created. If there are no changes, the report will be correct.- Now
xccov
reflects the difference between Xcode's different code coverage reports, which can be used to calculate changes in coverage that have occurred. For example, to highlight the difference betweenbefore.xccovreport
andafter.xccovreport
, call thexccov
command as follows:xccov diff --json before.xccovreport after.xccovreport
.- Static libraries and framework targates now appear in the coverage report as top-level records — coverage metrics are collected across all targets that include a static library or framework. It also solves the problem when the source files of the static library or the framework framework are included in the report, even if the target itself is removed from the code coverage in the schema.
If testing fails due to a crash test runner on startup, Xcode will try to generate a detailed message describing the error. This error can be studied in the test log, and if you are usingxcodebuild
, it will appear instdout
. It is also contained in the structured logs of the resulting package.
In the departure reports collected during testing, important sections such as the reason for departure or description are no longer lost.
carthage
gives the error "No available simulators for iOS were found." $ xcrun simctl list devices --json | grep -A16 12.1 "com.apple.CoreSimulator.SimRuntime.iOS-12-1" : [ { "availability" : "(unavailable, runtime profile not found)", "state" : "Shutdown", "isAvailable" : false, "name" : "iPhone 5s", "udid" : "DDD36346-A76F-42E8-80F4-6F11E1EE4BEB", "availabilityError" : "runtime profile not found" }, { "availability" : "(unavailable, runtime profile not found)", "state" : "Shutdown", "isAvailable" : false, "name" : "iPhone 6", "udid" : "21794717-BC89-45E4-9F57-8CF9D14A87D1", "availabilityError" : "runtime profile not found" }, --
- chances are that you will not be able to authenticate to the Wallet after choosing a card;
- chances are that you will not be able to purchase a prepaid plan using a mobile network.
After upgrading to Safari 12.1 from Safari 10.1.2, web pages may not display correctly. (47335741)
defaults delete com.apple.Safari
in the terminal. Please note that you lose all past Safari settings.Source: https://habr.com/ru/post/437814/