-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Update] Improve visibility of dynamic entities in sample #256
[Update] Improve visibility of dynamic entities in sample #256
Conversation
I'm in favor of adjusting the detent fraction than using geometry reader and edge inset. Also I will assign someone else to review as I don't have strong opinion on this one. |
I would prefer to adjust the sheet height, however, the height can only be adjusted in iOS 16+ using |
If there is a better API starting with iOS 16, then we should use it for users on iOS 16: var settingsSheetDetents: [Detent] {
if #available(iOS 16, *) {
// Use 'fraction(_:)' or 'height(_:)'.
} else {
return [.medium]
}
} FYI: There's another issue. When presented fullscreen, the sheet is not dismissible. It needs a dismiss button and could do with a title as well. The easiest way is by making the root of
|
It's definitely improved on iPhone :) Is there no way to size the sheet for its content? I wonder if any change is even necessary for iPad or Catalyst? Seems like the ideal would be that on iOS where the sheet fully covers the map, that the sheet be only as tall as it needs to be, and that the sheet's height is used to set the edge insets. |
No, no changes to the sheet are needed for iPad or Catalyst. This commit adds a fraction detent to the presented sheet based on size classes for iPhone in portrait orientation and iPad split view on iOS 16 so that the dynamic entities are visible. This implementation is more complex than this suggestion since the previously used sheet is a Toolkit sheet where |
Panel looks great on iPhone. For iPad and Mac Catalyst, should there be great blank areas at the bottom of the popover? I'm surprised SwiftUI doesn't default to "the right size for the content", so perhaps it isn't possible. |
Sheets do not seem to be adaptive to their content since they have a Instead of adding an implementation in this sample for iOS 16 it may be better to support iOS 16 in View+Sheet.swift with the ability to set |
@des12437 Is this ready for re-review? |
Yes, this PR is ready for re-review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shared/Samples/Add dynamic entity layer/AddDynamicEntityLayerView.swift
Outdated
Show resolved
Hide resolved
Shared/Samples/Add dynamic entity layer/AddDynamicEntityLayerView.swift
Outdated
Show resolved
Hide resolved
…dynamic-entity-layer-sample [Fix] Add dynamic entity layer settings presentation refactor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks much better, thank you.
Description
This PR addresses specific feedback from Nick on the initial testing for 200.1.0 sample viewer TestFlight app to improve the visibility of the dynamic entities in the
Add dynamic entity layer
sample. The visibility of the dynamic entities is improved by adding content offsets to the MapView so that the dynamic entities are still visible when the sheet is open.Linked Issue(s)
swift/issues/3931
How To Test
Dynamic Entity Settings
sheet and verify that there are dynamic entities in view.Screenshots
Before/After
iPhone 14 Pro Max
iPad Pro
Mac Catalyst
To Discuss
.presentationDetents([.fraction(0.40)])
does result in a shorter sheet on iPhone where the dynamic entities are visible, however, results in a full screen sheet on iPad and Mac Catalyst which covers the dynamic entities.