From ur view Controller u has a pass-through link Controller, message, header, e.g.
Settings.getAlertViewConroller(self, DialogTitle: "Test Sale", strDialogMessege: "You are performing a test sale. This is not a real transaction.")
where Setting is a subclass of NSObject.In Setting the class u, you must define the method as
class func getAlertViewConroller(globleAlert:UIViewController,DialogTitle:NSString,strDialogMessege:NSString){
let actionSheetController: UIAlertController = UIAlertController(title: DialogTitle, message: strDialogMessege, preferredStyle: .Alert)
let nextAction: UIAlertAction = UIAlertAction(title: "OK", style: .Default) { action -> Void in
}
actionSheetController.addAction(nextAction)
globleAlert.presentViewController(actionSheetController, animated: true, completion:nil)
}
I represent the UIAlertController.
source
share