Uialertcontroller *alertcontroller = [uialertcontroller alertcontrollerwithtitle:@ " hint " message:@" preferredstyle:(Uialertcontrollerstylealert )];
uialertaction *okaction = [uialertaction actionwithtitle:@ " OK " style :(uialertactionstyledefault) handler: ^ (uialertaction *action) {
NSLog(@ " pay attention to Learning ");
}];
uialertaction *cancelaction = [uialertaction actionwithtitle:@ " Cancel " style:(uialertactionstylecancel) handler: ^ (uialertaction *action) {
// Click on the button to write the method directly here
NSLog(@ " pay attention to Learning ");
}];
// Create a warning button
uialertaction *structlaction = [uialertaction actionwithtitle:@ " warning " Style:(uialertactionstyledestructive) handler: ^ (uialertaction *action) {
NSLog(@ " pay attention to Learning ");
}];
[Alertcontroller addaction: okaction];
[Alertcontroller addaction: cancelaction];
[Alertcontroller addaction: structlaction];
[self presentviewcontroller: Alertcontroller animated:YES completion: Nil];
iOS 9 Uialertcontroller instead of Uialertview