Open
Description
Thank you for sharing this amazing project. However I'd like to make a suggestion.
Even in Swift 4 it's recommended to prefer Data
over NSData
but in Swift 5 it became still more comfortable. You can replace the authorizationRef(fromExternalForm
method with
static func authorizationRef(fromExternalForm data: Data) throws -> AuthorizationRef? {
// Create an AuthorizationExternalForm from it's data representation
var authRef: AuthorizationRef?
var authRefExtForm = data.withUnsafeBytes{ $0.load(as: AuthorizationExternalForm.self) }
// Extract the AuthorizationRef from it's external form
try executeAuthorizationFunction { AuthorizationCreateFromExternalForm(&authRefExtForm, &authRef) }
return authRef
}
Metadata
Metadata
Assignees
Labels
No labels