Closed shjnbe closed 8 years ago
self.label.selectionHandler = ^(NSRange range, NSString *string) { // Put up an alert with a message if it's not an URL
NSString *message = [NSString stringWithFormat:@"You tapped %@", string]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Hello" message:message delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil]; [alert show]; };
i can't convert this code to swift code. Help me
label.selectionHandler = { range, string in /* show alert*/ }
self.label.selectionHandler = ^(NSRange range, NSString *string) { // Put up an alert with a message if it's not an URL
i can't convert this code to swift code. Help me