Any one please help to create action sheet controller programmatically with xcode6 using swift language.
Asked
Active
Viewed 4,207 times
-3
-
1The important bit is the "include minimal example". What have you tried so far that hasn't worked? – memmons Jun 06 '14 at 16:30
1 Answers
7
The question appears to be too generic.
May be you could refer to How would I create a UIAlertView in Swift?
This might help you get started.
A typical code for presenting UIActionSheet using swift would might like this:
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)

Community
- 1
- 1

Mehul Parmar
- 3,599
- 3
- 26
- 42