任何人都可以使用swift语言帮助以编程方式使用xcode6创建动作表控制器。
答案 0 :(得分:4)
这个问题似乎过于笼统。
您可以参考How would I create a UIAlertView in Swift?
这可能会帮助您入门。
使用swift呈现UIActionSheet的典型代码可能会这样:
var myActionSheet = UIAlertController(title: "Delete all data ?", message: "You may not be able to recover this back", preferredStyle: UIAlertControllerStyle.ActionSheet)
myActionSheet.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel, handler: nil))
myActionSheet.addAction(UIAlertAction(title: "Delete", style: UIAlertActionStyle.Default, handler: { (ACTION :UIAlertAction!)in
println("Deleting the data...")
}))
myActionSheet.addAction(UIAlertAction(title: "Delete Permanently", style: UIAlertActionStyle.Destructive, handler: { (ACTION :UIAlertAction!)in
println("Deleting data permanently...")
}))
self.presentViewController(myActionSheet, animated: true, completion: nil)