Im trying to present a view controller with this style:
As i read, it is no necessary to change the modalPresentationsStyle property to get the expected result, but it doesnt work for me. It can be because of the xcode version. Im in 10.1
The code:
import UIKit
class PostVC: UIViewController {
let optionsButton: UIButton = {
let but = UIButton()
but.setTitle("Options", for: .normal)
but.setTitleColor(.black, for: .normal)
but.addTarget(self, action: #selector(showOptions), for: .touchUpInside)
return but
}()
@objc func showOptions(sender: UIButton!){
present(optionsVC(), animated: true)
}
// MARK: - LyfeCicle
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
configNavigationController()
// MARK: - options
view.addSubview(optionsButton)
optionsButton.anchor(bottom: view.safeAreaLayoutGuide.bottomAnchor, width: view.bounds.size.width, height: 50)
}
}
class optionsVC: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .blue
}
}