I have a an objective-c class (RDAlertView)
which create an Alert (UIAlertView for ios < 8 and UIAlertController for ios >=8 )
Here is the code in Objective-C:
RDAlertView* alert = [[RDAlertView alloc] initWithTitle:@"Notification"
message:@"message"
completion:completion:^(NSInteger buttonIndex, NSInteger cancelButtonIndex, NSArray *textflieds) { }
cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
[alert show];
My question is: How to call this in Swift without any change in my class (if possible)?
Here is a link for the sample project : https://bitbucket.org/ejanowski/rdalertview-issue
These methods are treated like constructors. You can call them like this:
Caveat: written without an IDE, careful of syntax errors / typos
I think this is what you need:
Hope It will help.
UIAlertView
is deprecated in iOS 8.You can show an alert with this code: