Skip to content
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

Fix perception check in iOS 15. #38

Merged
merged 2 commits into from
Mar 14, 2024
Merged

Conversation

mbrandonw
Copy link
Member

Looks like demangled action closures have a slightly different format in iOS 15 than 16/17, so I generalized the isActionClosure helper a bit.

Comment on lines +44 to +59
if #available(iOS 16.0, *) {
WithPerceptionTracking {
Form {
Text(model.count.description)
Button("Decrement") { model.decrementButtonTapped() }
Button("Increment") { model.incrementButtonTapped() }
}
.presentationDetents([.medium])
}
} else {
WithPerceptionTracking {
Form {
Text(model.count.description)
Button("Decrement") { model.decrementButtonTapped() }
Button("Increment") { model.incrementButtonTapped() }
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something we'd have to do in our code to if we're supporting iOS 15?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JimRoepcke No, this if #available check is only for .presentationDetents([.medium]), which is iOS 16+.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Derp. (despite WithPerceptionTracking, my 👀 did not perceive or track that .presentationDetents line)

@mbrandonw mbrandonw merged commit db08755 into main Mar 14, 2024
2 checks passed
@mbrandonw mbrandonw deleted the fix-perception-check-ios15 branch March 14, 2024 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants