-
Notifications
You must be signed in to change notification settings - Fork 389
Simplify .introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) #431
-
Description
Thank you for the good work!
Passing this every time we use introspection is overkill imo, have you considered:
- passing only the last version instead of all
- have a default value for the introspect method we all the version included by default
This update make using the api more cumbersome, everyone will probably implement a wrapper method to avoid having.iOS(.v13, .v14, .v15, .v16, .v17, .v18)
everywhere. And that's if I am iOS only. Please let me know if I missed anything.
Checklist
- I have read the README before submitting this report.
- This issue hasn't been addressed in an existing GitHub issue or discussion.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 1 reply
-
See #280 (comment) and #280 (reply in thread)
Beta Was this translation helpful? Give feedback.
All reactions
-
Hey @davdroman,
I just migrated from a very old version of SwiftUIIntrospect and obviously ran into this version API. My use case is accessing the UIScrollView
in SwiftUI Lists.
As I understand, if one uses explicit versions, the closure won't be run for unlisted versions, or for listed versions too when the wanted view type doesn't exist.
And when using range syntax, the closure also won't be called if the wanted view type doesn't exist in the hierarchy.
Now if I got it all right, this means that the API under @_spi(Advanced)
doesn't have any downside compared to the explicit one, and I'm wondering why it wouldn't be the one that people should use by default? and thus not hidden behind @_spi(Advanced)
Did I miss anything?
Beta Was this translation helpful? Give feedback.