-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[Infra] Remove outdated availability and Swift version guards #1711
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,17 +31,13 @@ struct PostCell: View { | |
#if os(iOS) || os(macOS) | ||
starButton | ||
.onTapGesture { | ||
if #available(iOS 15, macOS 12, *) { | ||
#if compiler(>=5.5) && canImport(_Concurrency) | ||
Task { await | ||
post.didTapStarButtonAsync() | ||
} | ||
#else | ||
post.didTapStarButton() | ||
#endif | ||
} else { | ||
#if compiler(>=5.5) && canImport(_Concurrency) | ||
Task { await | ||
post.didTapStarButtonAsync() | ||
} | ||
#else | ||
post.didTapStarButton() | ||
} | ||
#endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The original code included an if #available(iOS 15, macOS 12, *) {
#if compiler(>=5.5) && canImport(_Concurrency)
Task { await
post.didTapStarButtonAsync()
}
#else
post.didTapStarButton()
#endif
} else {
post.didTapStarButton()
} |
||
} | ||
#elseif os(tvOS) | ||
starButton | ||
|
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.
The
.task
and.refreshable
view modifiers were introduced in iOS 15, tvOS 15, macOS 12, and watchOS 8. The pull request description states that the macOS deployment target is 11.0 and the watchOS deployment target is 7.0. Removing the#available
check means this code will be compiled and potentially run on macOS 11 and watchOS 7, where these modifiers are not available, leading to a runtime crash.