card-io / card.io-iOS-source

The open-source code for the card.io-iOS-SDK: provides fast, easy credit card scanning in mobile apps
Other
686 stars 372 forks source link

Nullability annotations for public headers #66

Open NKorchagin opened 8 years ago

NKorchagin commented 8 years ago

Ideally, all ObjC libraries using from Swift should have "nullability annotations" in their headers. These annotations describe the expected behavior of Objective-C pointers with respect to whether they would ever be nil in normal use. This lets the Swift importer figure out whether to import the symbol as an optional or not. For headers that haven't been annotated, the importer always pulls it in as an implicitly-unwrapped optional (pretty much the worst option).

So, it would be good to add nullability annotations for public headers for proper using CardIO both in Obj-C and Swift codebases.