mirror of
https://github.com/SvenTiigi/WhatsNewKit.git
synced 2026-04-02 23:58:58 -06:00
Add Support for 'presentationSizing' in iOS 18 #9
Labels
No labels
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
question
question
question
question
question
question
question
question
question
question
question
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github/WhatsNewKit#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bradleyandrew on 12/17/2024
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'?