The background of the pit is translucent, the method of OC is given on the net, and the translucent effect disappears after the animation ends. Through a variety of tossing, various experiments, finally fix.
Let Viewcontroller=storyboard.instantiateviewcontrollerwithidentifier ("corresponding Viewcontroller name to start") as Corresponds to the Viewcontroller name to start ViewController.view.backgroundColor = Uicolor (red:0, green:0, blue:0, alpha:0.5) Self.presentviewcontroller (Vpersonalizedsettingsviewcontroller, animated: Do whatever you want, Completion:nil)
It is important to note that to start the Viewcontroller must be set here translucent, if the corresponding Uiviewcontroller viewdidload inside the set is not translucent!
And then to start the uiviewcontroller viewdidload When set
Self.modalpresentationstyle =. Custom
So successful translucent.
Swift popup with a translucent uiviewcontroller background