我想通过点击按钮打开另一个视图的视图。我正在附上它,以便更好地理解。
This image is my desired output
This image is my base view, which you can see in my desired one at the back side, with less opacity
如果有人有任何想法,请帮助我..
答案 0 :(得分:1)
您可以使用此库(MZFormSheetPresentationController)创建具有图像,按钮和许多功能的警报视图。您可以按预期设计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)
}