Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import UIKit
- class YeuThichViewController: UIViewController {
- override func viewDidLoad() {
- super.viewDidLoad()
- // Do any additional setup after loading the view.
- }
- override func didReceiveMemoryWarning() {
- super.didReceiveMemoryWarning()
- // Dispose of any resources that can be recreated.
- }
- @IBAction func showActionSheet(sender: AnyObject) {
- let optionMenu = UIAlertController(title: nil, message: "Choose option", preferredStyle: .ActionSheet)
- let actionDelete = UIAlertAction(title: "Delte", style: .Default) { (action) in
- print("File Delete")
- }
- let actionSave = UIAlertAction(title: "Save", style: .Default) { (action) in
- print("File Save")
- }
- let actionCancel = UIAlertAction(title: "Cancel", style: .Cancel) { (action) in
- print("Action Cancel")
- }
- optionMenu.addAction(actionDelete)
- optionMenu.addAction(actionSave)
- optionMenu.addAction(actionCancel)
- self.presentViewController(optionMenu, animated: true, completion: nil)
- }
- /*
- // MARK: - Navigation
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
- // Get the new view controller using segue.destinationViewController.
- // Pass the selected object to the new view controller.
- }
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement