2017-04-04 15 views
-2

ボタンをクリックして別のビューでビューを開きたいとします。私はそれを理解しやすくするためにスナップをつけています。ボタンをクリックして同じ画面で別のビューを開く方法

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

誰もがアイデアを持っている場合は、このために私を助けてください..

答えて

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

ありがとうございます。それは私のために働く。 –

関連する問題