Reputation: 3356
I am trying to convert the following to swift but am not sure how to handle the parameters.
- (void)requestDiscoverabilityPermission:(void (^)(BOOL discoverable)) completionHandler{}
Upvotes: 1
Views: 1157
Reputation: 24041
it would look like e.g. this:
func requestDiscoverabilityPermission(completionHandler: (discoverable: Bool!) -> ()?) {
// ...
}
NOTE: you can play with the optional, non-optional parameters freely in your final code.
Upvotes: 1