You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+32-55Lines changed: 32 additions & 55 deletions
Original file line number
Diff line number
Diff line change
@@ -22,10 +22,10 @@ Swift 3.1
22
22
23
23
*[SE-0045][]:
24
24
25
-
The `Sequence` protocol now includes two new members,`prefix(while:)` and
26
-
`drop(while:)`. `prefix(while:)`is used to request the longest subsequence
27
-
satisfying a predicate. `drop(while:)`is used to request the subsequence
28
-
remaining after dropping the longest subsequence satisfying a predicate.
25
+
The `Sequence` protocol adds new members `prefix(while:)` and
26
+
`drop(while:)`. `prefix(while:)`requests the longest subsequence
27
+
satisfying a predicate. `drop(while:)`requests the remaining subsequence
28
+
after dropping the longest subsequence satisfying a predicate.
29
29
30
30
Swift 3.0
31
31
---------
@@ -34,25 +34,24 @@ Swift 3.0
34
34
35
35
*[SE-0101][]:
36
36
37
-
The functions `sizeof()`, `strideof()`, and `alignof()` have been removed.
38
-
Instead, these memory layout properties for a type `T` are now spelled
37
+
The functions `sizeof()`, `strideof()`, and `alignof()` have been removed.
38
+
Memory layout properties for a type `T` are now spelled
39
39
`MemoryLayout<T>.size`, `MemoryLayout<T>.stride`, and
40
40
`MemoryLayout<T>.alignment`, respectively.
41
41
42
42
*[SE-0136][]:
43
43
44
-
The functions `sizeofValue()`, `strideofValue()`, and `alignofValue()` have
45
-
been renamed `MemoryLayout.size(ofValue:)`, `MemoryLayout.stride(ofValue:)`,
44
+
The functions `sizeofValue()`, `strideofValue()`, and `alignofValue()` have been renamed to `MemoryLayout.size(ofValue:)`, `MemoryLayout.stride(ofValue:)`,
46
45
and `MemoryLayout.alignment(ofValue:)`.
47
46
48
47
*[SE-0125][]:
49
48
50
49
The functions `isUniquelyReferenced()` and `isUniquelyReferencedNonObjC()`
51
-
have been removed. The function `isKnownUniquelyReferenced()`should be called
52
-
instead. The class `NonObjectiveCBase` which classes using
53
-
`isUniquelyReferenced()` needed to inherit from was removed.
50
+
have been removed. Call the function `isKnownUniquelyReferenced()`instead.
51
+
52
+
Classes using `isUniquelyReferenced()` needed to inherit from `NonObjectiveCBase`. The `NonObjectiveCBase` class has been removed.
54
53
55
-
The method `ManagedBufferPointer.holdsUniqueReference`was renamed to
54
+
The method `ManagedBufferPointer.holdsUniqueReference`has been renamed to
56
55
`ManagedBufferPointer.isUniqueReference`.
57
56
58
57
```swift
@@ -77,8 +76,7 @@ Swift 3.0
77
76
78
77
*[SE-0124][]:
79
78
80
-
The initializers on `Int` and `UInt` accepting an `ObjectIdentifier` now need
81
-
to be spelled with an explicit `bitPattern` label.
79
+
Initializers on `Int` and `UInt` that accept an `ObjectIdentifier` must now use an explicit `bitPattern` label.
82
80
83
81
```swift
84
82
let x: ObjectIdentifier=...
@@ -94,9 +92,7 @@ Swift 3.0
94
92
95
93
*[SE-0120][]:
96
94
97
-
The collection methods `partition()` and `partition(isOrderedBefore:)` have
98
-
been removed from Swift. They were replaced by the method `partition(by:)`
99
-
which takes a unary predicate.
95
+
The collection methods `partition()` and `partition(isOrderedBefore:)` have been removed from Swift. They are replaced by the method `partition(by:)` which takes a unary predicate.
100
96
101
97
Calls to the `partition()` method can be replaced by the following code.
102
98
@@ -112,16 +108,11 @@ Swift 3.0
112
108
113
109
*[SE-0103][]:
114
110
115
-
Closure parameters are non-escaping by default, rather than explicitly being
116
-
annotated `@noescape`. Use `@escaping` to say that a closure parameter may
117
-
escape. `@autoclosure(escaping)` is now spelled `@autoclosure @escaping`.
118
-
`@noescape` and `@autoclosure(escaping)` are deprecated.
111
+
Closure parameters are now non-escaping by default and do not require `@noescape` annotation. Use `@escaping` to indicate that a closure parameter can escape. `@autoclosure(escaping)` is now spelled `@autoclosure @escaping`. `@noescape` and `@autoclosure(escaping)` are deprecated.
119
112
120
113
*[SE-0115][]:
121
114
122
-
To clarify the role of `*LiteralConvertible` protocols, they have
123
-
been renamed to `ExpressibleBy*Literal`. No requirements of these
124
-
protocols have changed.
115
+
To clarify their roles, `*LiteralConvertible` protocols have been renamed to `ExpressibleBy*Literal`. The protocol requirements are unchanged.
125
116
126
117
*[SE-0107][]:
127
118
@@ -130,17 +121,14 @@ Swift 3.0
130
121
to `UnsafePointer<U>` has been disallowed. `Unsafe[Mutable]RawPointer`
131
122
provides an API for untyped memory access, and an API for binding memory
132
123
to a type. Binding memory allows for safe conversion between pointer types.
133
-
See `bindMemory(to:capacity:)`, `assumingMemoryBound(to:)`, and
134
-
`withMemoryRebound(to:capacity:)`.
124
+
125
+
For detailed instructions on how to migrate your code to the new API refer to the [UnsafeRawPointer migration guide](https://swift.org/migration-guide/se-0107-migrate.html). See also: See `bindMemory(to:capacity:)`, `assumingMemoryBound(to:)`, and
126
+
`withMemoryRebound(to:capacity:)`.
135
127
136
128
*[SE-0096][]:
137
129
138
-
The `dynamicType` keyword has been removed from Swift. In its place a new
139
-
primitive function `type(of:)` has been added to the language. Existing code
140
-
that uses the `.dynamicType` member to retrieve the type of an expression
141
-
should migrate to this new primitive. Code that is using `.dynamicType` in
142
-
conjunction with `sizeof` should migrate to the `MemoryLayout` structure
143
-
provided by [SE-0101][].
130
+
The `dynamicType` keyword has been removed from Swift. It's replaced by a new primitive function `type(of:)`. Existing code
131
+
using the `.dynamicType` member to retrieve the type of an expression should migrate to this new primitive. Code using `.dynamicType` in conjunction with `sizeof` should migrate to the `MemoryLayout` structure introduced by [SE-0101][].
These bind the IEEE 754 roundToIntegral operations. They provide the
155
-
functionality of the C / C++ `round()`, `ceil()`, `floor()`, and `trunc()`
156
-
functions and other rounding operations as well.
142
+
These methods bind the IEEE 754 roundToIntegral operations. They provide the functionality of the C / C++ `round()`, `ceil()`, `floor()`, and `trunc()` functions along with other rounding operations.
157
143
158
-
As a follow-on to the work of [SE-0113][] and [SE-0067][], the following
159
-
mathematical operations in the `Darwin.C` and `glibc` modules now operate
160
-
on any type conforming to `FloatingPoint`: `fabs`, `sqrt`, `fma`,
144
+
Following onto [SE-0113][] and [SE-0067][], the following `Darwin.C` and `glibc` module mathematical operations now operate on any type conforming to `FloatingPoint`: `fabs`, `sqrt`, `fma`,
161
145
`remainder`, `fmod`, `ceil`, `floor`, `round`, and `trunc`.
162
146
163
-
See also the changes associated with [SE-0067][].
147
+
See also: the changes associated with [SE-0067][].
164
148
165
149
*[SE-0067][]:
166
150
167
151
The `FloatingPoint` protocol has been expanded to include most IEEE 754
168
152
required operations. A number of useful properties have been added to the
169
-
protocol as well, representing quantities like the largest finite value or
153
+
protocol, representing quantities like the largest finite value or
170
154
the smallest positive normal value (these correspond to the macros such as
171
155
FLT_MAX defined in C).
172
156
173
-
While almost all of the changes are additive, there are four changes that
174
-
will impact existing code:
157
+
While almost all of the changes are additive, four changes impact existing code:
175
158
176
159
- The `%` operator is no longer available for `FloatingPoint` types. It
177
-
was difficult to use correctly, and its semantics did not actually match
178
-
those of the corresponding integer operation, making it something of an
179
-
attractive nuisance. The new method `formTruncatingRemainder(dividingBy:)`
160
+
was difficult to use correctly and its semantics did not match
161
+
those of the corresponding integer operation. This made it something of an attractive nuisance. The new method `formTruncatingRemainder(dividingBy:)`
180
162
provides the old semantics if they are needed.
181
163
182
164
- The static property `.NaN` has been renamed `.nan`.
@@ -186,30 +168,25 @@ Swift 3.0
186
168
187
169
- The predicate `isSignaling` has been renamed `isSignalingNaN`.
188
170
189
-
See also the changes associated with [SE-0113][].
171
+
See also: the changes associated with [SE-0113][].
190
172
191
173
*[SE-0111][]:
192
174
193
-
Argument labels have been removed from Swift function types. Instead, they are
194
-
part of the name of a function, subscript, or initializer. Calls to a function
195
-
or initializer, or uses of a subscript, still require argument labels, as they
196
-
always have:
175
+
Argument labels have been removed from Swift function types. They are now
176
+
part of the name of a function, subscript, or initializer. Calls to a function or initializer, and subscript uses, still require argument labels as they always have:
197
177
198
178
```swift
199
179
funcdoSomething(x: Int, y: Int) { }
200
180
doSomething(x: 0, y: 0) // argument labels are required
201
181
```
202
182
203
-
However, unapplied references to functions or initializers no longer carry
204
-
argument labels. For example:
183
+
Unapplied references to functions or initializers no longer carry argument labels. For example:
205
184
206
185
```swift
207
186
let f =doSomething(x:y:) // inferred type is now (Int, Int) -> Void
208
187
```
209
188
210
-
Additionally, explicitly-written function types can no longer carry argument
211
-
labels, although one can still provide parameter name for documentation
212
-
purposes using the '_' in the argument label position:
189
+
Explicitly-written function types can no longer carry argument labels. You can still provide parameter names for documentation purposes using the '_' in the argument label position:
0 commit comments