I'm having trouble translating Objective-C sample from documentation into Swift. Here is the Objective-C code I'm trying to translate:
void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) =
^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
if(!completed && error){
NSLog(@"FAILED! due to error in domain %@ with error code %u",
error.domain, error.code);
}
So fat I have translated that to this Swift code:
let completionHandler: UIPrintInteractionCompletionHandler = {
(controller: UIPrintInteractionController, completed: Bool, error: Error) in
if (!completed && error) {
}
}
The part I don't know how to translate is the use of NSLog. Should I use NSLog in my Swift code?