I'm trying to create a dialog box like this, but have failed in every attempt. This box overrides the rest of the content, has two textField and a choice box. Could someone help me? I use a dynamic programming to create the dialog box? or I use a new ViewController and call it via code? Where do I start?
Asked
Active
Viewed 7,792 times
2 Answers
7
If I understand you correctly, and the blur effect is necessary, then the standard UIAlertController
won't let you do that. You could achieve this affect by 1.) creating a separate view controller in storyboard, 2.) add UIBlurEffect
to it, 3.) add a UIView
to make the 'form' and add text fields etc to that. Then, from wherever you want the view to be launched (button, etc) create the segue to this view controller and set it to 'modal'. Does this help?

travelnsam
- 193
- 9
-
I'm doing what you referred me. The first part, the modal, I've got the answer to the question ([link](http://stackoverflow.com/questions/33104743/swift-modal-view-controller-with-transparent-background)). I need to know now how do the blur in the background View – Oct 13 '15 at 17:26
-
Ahh ok. The blur background can be added directly from the storyboard. In Xcode, from the Object Library (lower right hand side, the same place you add text boxes, images, etc) there is an object called "Visual Effect with Blur". If you type 'blur' into the search box you should find it easily. Add this to the UIView, underneath the form you have created. – travelnsam Oct 13 '15 at 19:32
0
You probably want to create a UIAlertController. Here are the relevant docs:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIAlertController_class/
This tutorial should get you going in the right direction:
http://www.raywenderlich.com/84043/ios-8-visual-effects-tutorial

Guillermo Alvarez
- 1,695
- 2
- 18
- 23