| Start |
|---|
UnsafeMutablePointer A pointer for accessing and manipulating data of a specific type. You use instances of the UnsafeMutablePointer type to access data of a specific type in memory. The type of data that a pointer can access is the pointer's Pointee type. UnsafeMutablePointer provides no automated memory management or alignment guarantees. You are responsible for handling the life cycle of any memory you work with through unsafe pointers to avoid leaks or undefined behavior. Memory that you manually manage can be either untyped or bound to a specific type. You use the UnsafeMutablePointer type to access and manage memory that has been bound to a specific type. (Source (opens new window)) Converted to Swift 3.0 from original source (opens new window) |
| Practical Use-Case for Buffer Pointers Deconstructing the use of an unsafe pointer in the Swift library method; Purpose: Creates a new string by copying and validating the null-terminated UTF-8 data referenced by the given pointer. This initializer does not try to repair ill-formed UTF-8 code unit sequences. If any are found, the result of the initializer is **Source**, **Apple Inc., Swift 3 header file** (For header access: In Playground, Cmd+Click on the word Swift) in the line of code:
(Source, Apple Inc., Swift Header File Example) RemarksClosely aligned concepts required to complete one's understanding of (Unsafe) BufferPointers.
(Source, Swiftdoc.org (opens new window)) |
Read Article
https://develop.horje.com/learn/1434/reference