How is it possible when opening a UISheetPresentationController, the ViewController under to remain the same and to not shrink?

Viewed 169

I have created a View Controller called RegistrationFormViewController, which is a basic registration form which opens on tap of the main view controller button. The question: Is there any possibility that when opening a UiSheetPresentationController the view controller behind to not shrink?

Snippet of my code when adding the UISheetPresentationController:

@objc func registerSheet(){
    var registrationSheet = RegistrationFormViewController()
   
    if #available(iOS 15.0, *) {
        if let sheet  = registrationSheet.presentationController as? UISheetPresentationController{
            sheet.detents = [.medium()]
        }
    } else {
        self.present(registrationSheet, animated: true, completion: nil)
    }
}

enter image description here

0 Answers
Related