热门IT资讯网

UIAlertController 控制器多能用法 ios8新

发表于:2024-11-27 作者:热门IT资讯网编辑
编辑最后更新 2024年11月27日,var alert:UIAlertController = UIAlertController(title: "确定不玩了嘛?", message: "", preferredStyle: UIAle



var alert:UIAlertController = UIAlertController(title: "确定不玩了嘛?", message: "", preferredStyle: UIAlertControllerStyle.ActionSheet)

//UIAlertControllerStyle.ActionSheet

//UIAlertControllerStyle.Alert

var action1 = UIAlertAction(title: "确定", style: UIAlertActionStyle.Destructive) { (action) -> Void in

println("exe");

}

var action2 = UIAlertAction(title: "取消", style: UIAlertActionStyle.Cancel) { (action) -> Void in

println("Cancel");

}

alert.addAction(action1);

alert.addAction(action2);

self.presentViewController(alert, animated: true) { () -> Void in

println(11);

}





0