objective c - Create a simple Alert in swift -


it looks alertstatus cannot used in swift.

can guys please me implementing alternative solution code below?

  [self alertstatus:@"message!" :@"alert title" :0]; 

try following code

let alert = uialertview() alert.title = "title" alert.message = "my message" alert.addbuttonwithtitle("ok") alert.show() 

but in ios 8

uialertview deprecated. use uialertcontroller preferredstyle of uialertcontrollerstylealert. should

var alert = uialertcontroller(title: "title", message: "message", preferredstyle: uialertcontrollerstyle.alert) alert.addaction(uialertaction(title: "ok", style: uialertactionstyle.default, handler: nil)) self.presentviewcontroller(alert, animated: true, completion: nil) 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -