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
The types `UnsafePointer`, `UnsafeMutablePointer`,
14
+
`AutoreleasingUnsafeMutablePointer`, `OpaquePointer`, `Selector`, and `Zone`
15
+
(formerly `NSZone`) now represent non-nullable pointers, i.e. pointers that
16
+
are never `nil`. A nullable pointer is now represented using `Optional`, e.g.
17
+
`UnsafePointer<Int>?` For types imported from C, non-object pointers (such as
18
+
`int *`) now have their nullability taken into account.
19
+
20
+
One possible area of difficulty is passing a nullable pointer to a function
21
+
that uses C variadics. Swift will not permit this directly, so as a
22
+
workaround please use the following idiom to pass it as a pointer-sized
23
+
integer value instead:
24
+
25
+
```swift
26
+
unsafeBitCast(nullablePointer, to: Int.self)
27
+
```
28
+
6
29
*[SE-0046] (https://github.com/apple/swift-evolution/blob/master/proposals/0046-first-label.md) Function parameters now have consistent labelling across all function parameters. With this update the first parameter declarations will now match the existing behavior of the second and later parameters. This change makes the language simpler.
0 commit comments