UIViewController view with transparent background in swift 3.0

I present a viewController with a transparent background. But the components on this viewController are invisible when they are presented. An empty viewController is observed. I gave an alpha value and a black background color. This is my code when I call transparent viewController

if indexPath.row==0
{
   let modalViewController = PopUpViewController()
    modalViewController.modalPresentationStyle = .overCurrentContext
    present(modalViewController, animated: true, completion: nil)
 }

enter image description here

But on this controller there is an orange color UIView, invisible Thanks in advance enter image description here  enter image description here

+4
source share
2 answers

You just need to submit your second Viewcontroller, which has a transparent background, modally. with the following configuration:

enter image description here

and what is the result:

enter image description here

for those who are not familiar with Opacity: in such a situation, for transparency, it is better to use Opacity instead of Alpha

enter image description here

+1

( ) innerView (OrangeView), , . ( )

  • viewController clearColor.
  • OuterView .
  • Segue Segue , .

enter image description here

.

enter image description here

+1

Source: https://habr.com/ru/post/1680702/


All Articles