Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.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 如何通过单击swift中的按钮在同一屏幕上打开另一个视图_Ios_Swift - Fatal编程技术网

Ios 如何通过单击swift中的按钮在同一屏幕上打开另一个视图

Ios 如何通过单击swift中的按钮在同一屏幕上打开另一个视图,ios,swift,Ios,Swift,我想通过单击按钮在另一个视图上打开一个视图。我附上它的快照,以便更好地理解 如果有人有想法,请帮助我。您可以使用此库()创建带有图像、按钮和许多函数的类似警报的视图。您可以按预期设计viewController func formSheetControllerWithNavigationController() -> UINavigationController { return self.storyboard!.instantiateViewContr

我想通过单击按钮在另一个视图上打开一个视图。我附上它的快照,以便更好地理解

如果有人有想法,请帮助我。

您可以使用此库()创建带有图像、按钮和许多函数的类似警报的视图。您可以按预期设计viewController

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)
}