AndreaMiotto / PartialSheet

A SwiftUI Partial Sheet fully customizable with dynamic height

Home Page:https://github.com/AndreaMiotto/PartialSheet/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect Content Offset for Face-ID iPhones

jtressle opened this issue · comments

Version 2.1.12 has an issue where the partial sheet is buried under the safe area. You can see this on any of the examples running on an iPhone 12 Pro, or similar.

I ended up using this code to fix the issue on each of my partial sheets:

if let safeHeight = UIApplication.shared.windows.first?.safeAreaInsets.bottom, safeHeight > 0.0 {
  Spacer().frame(height:safeHeight)
}

This code also works even though the spacer height is set to zero.

if let safeHeight = UIApplication.shared.windows.first?.safeAreaInsets.bottom, safeHeight > 0.0 {
  Spacer().frame(height:0.0)
}

Thanks

commented

Sorry for the delay, it's going to be solved today

It works! Many thanks!