A subclass of UIViewController that will present a view as a popover dialog.
- XCode 9
-
Add two view controllers
-
Add a button to the first view controller
-
Set the class of the second view controller to DialogViewController
-
Add a Modal Presentation segue from the button in the first view controller to the dialog view controller
-
Disable the Animates checkbox
-
Click on the main view of the dialog view controller
-
Change the background color to Clear Color
-
Click on the dialog view controller
-
Change presentation to Over Current Context
-
Add the dialog view you want to show in the dialog view controller and position it wherever you want
-
Connect the mainView Outlet of the dialog view controller to the view added
-
Run the application and click on the button. It should open the dialog view
If you want to use the dialog view controller in your own project just copy the DialogView Folder.
- Maher Santina - Initial work
This project is licensed under the MIT License - see the LICENSE.md file for details