I'm having trouble converting this line to Swift:
(void)authenticateLayerWithUserID:(NSString *)userID completion:(void (^)(BOOL success, NSError * error))completion { }
Here's my line in Swift:
func authenticateLayerWithUserID(userID: NSString) {(success: Bool, error: NSError?) -> Void in }
Anyone have some insight into what I'm not doing correctly?
I would translate this kind of function in Swift with a "completion handler":
And call it like this:
EDIT:
Following your comments, here's a new example within a class function, and with an "if else":