gordontucker / FittedSheets

Bottom sheets for iOS
MIT License
1.32k stars 278 forks source link

For fullscreen mode is there any way to remove the top spacing between the pull bar and screen top area for devices with a notch? #190

Closed harish-suthar closed 1 year ago

harish-suthar commented 1 year ago

For fullscreen mode is there any way to remove the top spacing between the pull bar and screen top area for devices with a notch?

See screenshot below for reference.

Simulator Screen Shot - iPhone 13 mini - 2022-12-29 at 15 40 48

nunojfg commented 1 year ago
extension UIViewController {
    var topBarHeight: CGFloat {
        var top = self.navigationController?.navigationBar.frame.height ?? 0.0
        if #available(iOS 13.0, *) {
            top += UIApplication.shared.windows.first?.windowScene?.statusBarManager?.statusBarFrame.height ?? 0
        } else {
            top += UIApplication.shared.statusBarFrame.height
        }
        return top
    }
}

sheetController.minimumSpaceAbovePullBar = presentingViewController.topBarHeight
harish-suthar commented 1 year ago

@nunojfg This is not working for it instead increases the above space, what I want to do is make it full screen without any space above.