-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
A view controller doesn't appear when the popup is presented with the following code - just a blur view. What am I missing here?
View Controller A:
func showPopup() {
let vc = ViewControllerB()
let popup = PopupDialog(viewController: vc)
vc.popup = popup
self.present(popup, animated: true, completion: nil)
}
View Controller B:
class ViewControllerB: UIViewController {
var popup: PopupDialog?
override func viewDidLoad() {
super.viewDidLoad()
setupView()
}
lazy var card: UIView = {
let view = UIView()
view.backgroundColor = .white
view.translatesAutoresizingMaskIntoConstraints = false
return view
}()
func setupView() {
view.addSubview(card)
card.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true
card.rightAnchor.constraint(equalTo: view.rightAnchor).isActive = true
card.topAnchor.constraint(equalTo: view.topAnchor).isActive = true
card.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
}
}
Metadata
Metadata
Assignees
Labels
No labels