Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swift how to dereference unsafemutablepointer

func foobar(_ myPointer: UnsafeMutablePointer<CGRect>) {
    let dereferencedPointer = myPointer.pointee
    print(myPointer.pointee.width, myPointer.pointee.height)
    // Same as print(myCGRect.width, myCGRect.height)
}
Source by useyourloaf.com #
 
PREVIOUS NEXT
Tagged: #swift #dereference #unsafemutablepointer
ADD COMMENT
Topic
Name
4+8 =