Reputation: 743
I want to call a UIView with transparent background from table cell.
let myView = MyViewController()
myView.view.backgroundColor = .clear
tableController.present(myView, animated: true, completion: nil)
But there remains such an unpleasant border.
myView.modalPresentationStyle = .fullScreen
makes it worse - remove background view.
Upvotes: 0
Views: 1139
Reputation: 650
Important to note, if you're using a .xib, viewDidLoad
isn't the correct place to place your modalPresentationStyle
change. This should be done before the view is loaded.
Upvotes: 0
Reputation: 422
You can present new viewController in a .fullscreen (or any other) mode with transparent background
opacity
to any value less than 100% (e.g. 30% - see screen below).overCurrentContext
Here is how you can do that programmatically
//apply that for viewController that will be displayed at the top
viewController.modalPresentationStyle = .fullScreen
viewController.modalPresentationStyle = .overCurrentContext
Upvotes: 1