Ios 如何通过单击swift中的按钮在同一屏幕上打开另一个视图
我想通过单击按钮在另一个视图上打开一个视图。我附上它的快照,以便更好地理解 如果有人有想法,请帮助我。您可以使用此库()创建带有图像、按钮和许多函数的类似警报的视图。您可以按预期设计viewControllerIos 如何通过单击swift中的按钮在同一屏幕上打开另一个视图,ios,swift,Ios,Swift,我想通过单击按钮在另一个视图上打开一个视图。我附上它的快照,以便更好地理解 如果有人有想法,请帮助我。您可以使用此库()创建带有图像、按钮和许多函数的类似警报的视图。您可以按预期设计viewController func formSheetControllerWithNavigationController() -> UINavigationController { return self.storyboard!.instantiateViewContr
func formSheetControllerWithNavigationController() -> UINavigationController {
return self.storyboard!.instantiateViewController(withIdentifier: "formSheetController") as! UINavigationController
}
func passDataToViewControllerAction() {
let navigationController = self.formSheetControllerWithNavigationController()
let formSheetController = MZFormSheetPresentationViewController(contentViewController: navigationController)
formSheetController.presentationController?.isTransparentTouchEnabled = false
formSheetController.presentationController?.shouldCenterVertically = true
formSheetController.presentationController?.shouldCenterHorizontally = true
formSheetController.presentationController?.shouldDismissOnBackgroundViewTap = true
let yourViewController = navigationController.viewControllers.first as! EventDisplayViewController
yourViewController.delegate = self
self.present(formSheetController, animated: true, completion: nil)
}