0

Im trying to present a view controller with this style:

enter image description here

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
    }
    
}
l4x3
  • 3
  • 3
  • 1
    Does this answer your question? [modalPresentationStyle default value in iOS 13](https://stackoverflow.com/questions/58165069/modalpresentationstyle-default-value-in-ios-13) or https://stackoverflow.com/questions/56435510/presenting-modal-in-ios-13-fullscreen – pkamb Mar 29 '21 at 20:01
  • Does this answer your question? [Presenting modal in iOS 13 fullscreen](https://stackoverflow.com/questions/56435510/presenting-modal-in-ios-13-fullscreen) – aheze Mar 29 '21 at 20:03

0 Answers0