Swift-action table (Uiactionsheel) usage, also called bottom warning box

Source: Internet
Author: User

1, create an action table below (or call the bottom warning box) and pop up the display

123456789101112131415161718 class ViewController: UIViewController,UIActionSheetDelegate {    override func viewDidLoad() {        super.viewDidLoad()               var actionSheet=UIActionSheet()        //actionSheet.title = "请选择操作"        actionSheet.addButtonWithTitle("取消")        actionSheet.addButtonWithTitle("动作1")        actionSheet.addButtonWithTitle("动作2")        actionSheet.cancelButtonIndex=0        actionSheet.delegate=self        actionSheet.showInView(self.view);    }    func actionSheet(actionSheet: UIActionSheet!,clickedButtonAtIndex buttonIndex:Int){            println("点击了:"+actionSheet.buttonTitleAtIndex(buttonIndex))    }}

2, in the general case, the tool bar, or the label bar display in the way the call is not the same

123 actionSheet.showInView(self.view);  //一般情况actionSheet.showFromToolbar(self.navigationController.toolbar)  //工具条的情况下actionSheet.showFromTabBar(self.tabBar)  //标签条的情况下

Swift-action table (Uiactionsheel) usage, also called bottom warning box

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.