迅速な言語を使用してxcode6でプログラムでアクションシートコントローラーを作成するのを手伝ってください。
3778 次
1 に答える
7
質問が一般的すぎるようです。
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)
于 2014-06-06T14:37:18.180 に答える