Objective-c has a concept of a pointer to a pointer. If you dereference the first pointer you can access the original
void makeFive(int *n) { *n = 5; } int n = 0; makeFive(&n); // n is now 5 When this is bridged to Swift 3 it becomes an UnsafeMutablePointer
func makeFive(_ n: UnsafeMutablePointer<Int>) { n.memory = 5 } var n: Int = 0 makeFive(&n) // n is now 5 However, as of Swift 4, this behavior has changed and the memory property is no longer available.
What would be the swift 4 equivalent of the makeFive(_:) function?
Update Thanks to Hamish, I now know that "memory" was renamed to pointee.
.pointee; but don't useUnsafeMutablePointerhere. Useinoutif you need to mutate a caller-side variable (and this shouldn't be that often).