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

Convert stored properties into computed properties #295

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

galijot
Copy link
Contributor

@galijot galijot commented Jun 6, 2023

This PR addresses a compiler error in Xcode 15.0 Beta, which states:

Stored properties cannot be marked potentially unavailable with '@available'

Since use of such properties is inhibited through a compiler error, I've simply replaced the stored properties marked as unavailable with computed properties that are returning the same result they're returning now.

Addresses a compiler error in Xcode 15.0 Beta
@ephread ephread merged commit 2a93135 into ephread:main Jun 9, 2023
1 of 2 checks passed
@ephread
Copy link
Owner

ephread commented Jun 9, 2023

Thank you!

@gentique
Copy link

Wouldn't it have been better if instead of

public var allowTap: Bool { return true }

to do this:

public var allowTap: Bool { self.singleTapGestureRecognizer.view != nil }

It would stay consistent with the new API instead of being a computed property which in essence is a constant?

@galijot
Copy link
Contributor Author

galijot commented Jun 15, 2023

Wouldn't it have been better if instead of

public var allowTap: Bool { return true }

to do this:

public var allowTap: Bool { self.singleTapGestureRecognizer.view != nil }

It would stay consistent with the new API instead of being a computed property which in essence is a constant?

Since the property is annotated with @available(*, unavailable, renamed: "isUserInteractionEnabled"), accessing it results in a compiler error: 'allowTap' has been renamed to 'isUserInteractionEnabled', because of which a value of this property is irrelevant.

(I believe) It's just kept to make upgrades from older package versions easier to perform, since it's not really obvious that isUserInteractionEnabled does the same thing that allowTap used to do.

@krishnamurthy-Aosta
Copy link

Thanks man, Save my time

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

4 participants