adamfootdev / BottomSheet

Access UISheetPresentationController in SwiftUI on iOS 15 using a simple .bottomSheet modifier.
MIT License
346 stars 40 forks source link

Allow import into projects with min target < iOS 15, presentedViewController chaining fix #13

Closed camdeardorff closed 3 years ago

camdeardorff commented 3 years ago

I had a use for this package in a project that cannot require iOS 15 yet, though current config didn't allow for that use case. Setting an older minimum for the package but annotating the views and extensions with @available(iOS 15, *) keeps usage as intended.

Also found an issue where in a stack of presented view controllers the bottom sheet would not be presented, this is because the view controller this bottom sheet would be presented from is not at the top of the stack. Fix was just to follow the .presentedViewController chain to find the top most presented view controller.