You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When presenting a .sheet in iOS 17, the default was to present it as full height of the iPad Display.
When presenting a .sheet in iOS 18, the default is to present it as half height of the iPad Display.
'WhatsNewView' is presented as a sheet and defaults to the smaller sized version on iOS 18.
If you include a number of 'WhatsNew.Feature' in a 'WhatsNew', a user will be forced to scroll through them on a smaller sheet in iOS 18 rather than having them presented at full height with zero scroll as they would display in iOS 17.
I apply this to my views that are used as a .sheet to solve for this issue on various iOS Versions:
extension View {
func pageSheetSizing() -> some View {
if #available(iOS 18.0, *) {
AnyView(self.presentationSizing(.page))
} else {
// Fallback on earlier versions
AnyView(self)
}
}
}
I initally tired to get it to work like this with the code below, but it did not work as 'pageSheetSizing' needs to be applied to the actual view: .whatsNewSheet().pageSheetSizing()
I ended up settling on a custom implementation of '.whatsNewSheet()' and used it like this on the view I wanted to apply it to:
This works to present a full height sheet in iOS 17 and iOS 18.
It would be good to have native support for this in WhatsNewKit, perhaps in 'WhatsNew.Layout' where you could specify the desired 'PresentationSizing'?
The text was updated successfully, but these errors were encountered:
With iOS 18 Apple introduced the 'presentationSizing' presentation modifier as per this documentation:
https://developer.apple.com/documentation/swiftui/view/presentationsizing(_:)
When presenting a .sheet in iOS 17, the default was to present it as full height of the iPad Display.
When presenting a .sheet in iOS 18, the default is to present it as half height of the iPad Display.
'WhatsNewView' is presented as a sheet and defaults to the smaller sized version on iOS 18.
If you include a number of 'WhatsNew.Feature' in a 'WhatsNew', a user will be forced to scroll through them on a smaller sheet in iOS 18 rather than having them presented at full height with zero scroll as they would display in iOS 17.
I apply this to my views that are used as a .sheet to solve for this issue on various iOS Versions:
I initally tired to get it to work like this with the code below, but it did not work as 'pageSheetSizing' needs to be applied to the actual view:
.whatsNewSheet().pageSheetSizing()
I ended up settling on a custom implementation of '.whatsNewSheet()' and used it like this on the view I wanted to apply it to:
This works to present a full height sheet in iOS 17 and iOS 18.
It would be good to have native support for this in WhatsNewKit, perhaps in 'WhatsNew.Layout' where you could specify the desired 'PresentationSizing'?
The text was updated successfully, but these errors were encountered: