Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Simplify .introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) #431

Unanswered
lionel-alves asked this question in Q&A
Discussion options

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

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
Comment options

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug Something isn't working
Converted from issue

This discussion was converted from issue #429 on August 05, 2024 21:42.

AltStyle によって変換されたページ (->オリジナル) /