Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 这个popover类的名称是什么?_Ios_Swift_Uiview - Fatal编程技术网

Ios 这个popover类的名称是什么?

Ios 这个popover类的名称是什么?,ios,swift,uiview,Ios,Swift,Uiview,我找不到此“popover”的类的名称。苹果在他们的应用程序中经常使用它 我搜索了popover,NSAlert,自定义隐藏/可见视图,以及更多 它叫什么 这是UIAlertController。在ios7之前,它被称为UIActionSheet UIAlertController对象向用户显示警报消息。此类替换用于显示警报的UIActionSheet和UIAlertView类 @IBAction func showActionSheetTapped(sender: AnyObject)

我找不到此“
popover
”的类的名称。苹果在他们的应用程序中经常使用它

我搜索了
popover
NSAlert
,自定义隐藏/可见视图,以及更多

它叫什么


这是
UIAlertController
。在ios7之前,它被称为
UIActionSheet

UIAlertController
对象向用户显示警报消息。此类替换用于显示警报的UIActionSheet和UIAlertView类

    @IBAction func showActionSheetTapped(sender: AnyObject) {
  //Create the AlertController
  let actionSheetController: UIAlertController = UIAlertController(title: "Action Sheet", message: "Swiftly Now! Choose an option!", preferredStyle: .ActionSheet)

  //Create and add the Cancel action
  let cancelAction: UIAlertAction = UIAlertAction(title: "Cancel", style: .Cancel) { action -> Void in
    //Just dismiss the action sheet
  }
  actionSheetController.addAction(cancelAction)
    //Create and add first option action
  let takePictureAction: UIAlertAction = UIAlertAction(title: "Take Picture", style: .Default) { action -> Void in
    //Code for launching the camera goes here
    }
  actionSheetController.addAction(takePictureAction)
  //Create and add a second option action
  let choosePictureAction: UIAlertAction = UIAlertAction(title: "Choose From Camera Roll", style: .Default) { action -> Void in
    //Code for picking from camera roll goes here
    }
  actionSheetController.addAction(choosePictureAction)

  //Present the AlertController
  self.presentViewController(actionSheetController, animated: true, completion: nil)
}
输出:


它可能会对您有所帮助。

看起来像是UIAlertControllerInDect,在Xcode 6 UIActionShit中的样式ActionSheet,现在Xcode 7是UIAlertController,还添加了“UIActionShit”