0

I would like to draw a particular shape in Main.storyboard. It should look like this:

enter image description here

This shape does not have to be created programmatically. The shape will always be the same, and the text inside the shape will always be the same. This shape should appear in front of the other items in the View Controller (so that the entire shape is always visible). In addition, when the user taps anywhere outside of the shape, the shape should disappear. Within the View Controller, this shape will be relatively small overall. How can I do this? Thanks.

Everett
  • 387
  • 1
  • 4
  • 17
  • 2
    try popover with other viewcontroller refer this link https://stackoverflow.com/questions/28521583/uipopoverpresentationcontroller-on-iphone-doesnt-produce-popover – priyadharshini Jun 05 '18 at 06:41

1 Answers1

0

You don’t need to make this by yourself, there is UIPopoverController‏ from apple.

Examples of how to do this:

here,

and here

enter image description here

  • I have tried the first tutorial mentioned above, however the popOverViewController covers the entire screen (even though I have set the height and width values). Do you know why the height and width values are not taking effect? – Everett Jun 05 '18 at 07:43
  • On the attributes inspector check the box next to "Use Preferred Explicit Size" and replace func adaptivePresentationStyleForPresentationController to the new syntax: func adaptivePresentationStyle(for controller: UIPresentationController) -> UIModalPresentationStyle { return .none } – student swift Jun 05 '18 at 07:55