[swift-users] Double pointer in ObjC function signature importing incorrectly in Swift 3?

Michael Gardner gardnermj at gmail.com
Tue Sep 20 12:32:46 CDT 2016


I'm using an Objective-C library that has me provide a callback that takes a double-pointer parameter like this, where only the inner pointer is nullable:

CKRecord *_Nonnull *_Nullable inOutRecordPtr

Swift 2 imported this as an AutoreleasingUnsafeMutablePointer<CKRecord?>, as expected. However, Swift 3 is importing it as AutoreleasingUnsafeMutablePointer<CKRecord>?, which breaks the library's API since there's no way to return a new record.

Is this a Swift 3 bug, or am I missing something?


More information about the swift-users mailing list