2

I don't know how can I do that in Xcode , maybe with the Interface Builder or programmaticaly ?

I want to display a modal like this :

enter image description here

I can do that with pods but I want to create my own modal

ewan
  • 276
  • 2
  • 17

1 Answers1

1

I always make this kind of modals in Storyboard. Give the view of the view controller a black background color, with an alpha lower than 1. Also make sure the modalPresentationStyle is set to Over Current Context.

Jan Doornbos
  • 639
  • 6
  • 25
  • I create another viewcontroller and present it with segue ?? – ewan Jul 25 '16 at 18:44
  • Can you explain me how to present this modal ? – ewan Jul 25 '16 at 18:53
  • Yes, you can make a segue, and present it modally. Or you can do it in code with self.presentViewController(vc, animated: true, completion: nil). – Jan Doornbos Jul 25 '16 at 19:06
  • I'm trying but I get this http://img15.hostingpics.net/pics/669058Capturede769cran20160725a768210924.png and I use this http://stackoverflow.com/questions/24336187/how-to-present-a-modal-atop-the-current-view-in-swift to create but not working I think – ewan Jul 25 '16 at 19:11
  • Make sure you use Over Current Context, not Current Context. – Jan Doornbos Jul 25 '16 at 19:12