Translate Services Menu to Swift


Gerriet M. Denkmann
 

This works:

- (void)lookUppString:(NSPasteboard *)pboard userData:(NSString *)data error:(NSString * _Nullable *)error
{
NSLog(@“%s",__FUNCTION__);
}

But this does not:
func lookUppString(_ pboard: NSPasteboard, _ userData: String, _ error: AutoreleasingUnsafeMutablePointer<NSString?>)
{
print(#function)
}

It prints:
Cannot find service provider for selector lookUppString:userData:error: or lookUppString:: for service lookUppString

What am I doing wrong?

Gerriet

Join cocoa@apple-dev.groups.io to automatically receive all group messages.