-
Notifications
You must be signed in to change notification settings - Fork 61
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
UIApplication avoidance #46
base: main
Are you sure you want to change the base?
Conversation
… wants to open the cocoapods URL, rather than using UIApplication. This is needed in situations where the view controller needs to live in a framework target that doesn't allow UIApplication to be used.
Hello Kieran, and thanks for the pull request. I appreciate that not relying on If somebody has a better solution, please let us know. |
So what I did is this: https://github.com/LiulietLee/LLDialog/blob/master/Source/LLDialog.swift#L69-L73 Since swiftlang/swift#12410 got merged, you can just use
|
That’s super interesting. Thank you very much for pointing that out, @ApolloZhu! I guess we should update this pull request to replace the closure with the appropriate |
So I’ve tried adding the
It seems like this should be easily solvable by testing the availability when creating the gesture recognizer, but as fas as I understand, this type of condition does not exist. Something like To reiterate: I want to keep the current behavior in a non-Extension context, and I don’t want to require more code from the app using this library. Am I missing something, or do we need to wait for more flexible compiler instructions? |
FYI in XCode 13b3 this started causing issues, as the SwiftPM packages are being built with Looking at the discussion in Swift Forums, right now the only solution seems to be annotating either the class or some part of it with I see two options here:
@vtourraine Are you open to receiving any PR for this or you'd rather wait and see if there's any fixes in this area on further betas? |
@ifrins Hello Francesc, and thanks a lot for raising this issue! It looks like we should do something about it, but maybe there’s an easier solution. I think we can add the @available(iOS 9.0.0, tvOS 9.0.0, *)
@available(iOSApplicationExtension, unavailable)
open class AcknowListViewController: UITableViewController { |
What you suggested works (I created a fork doing exactly that to unblock myself 😊); but it would break if anyone is using this VC in an extension (not really sure if that's a real use case though). |
Right, so we’re on the same page. I think you should create a pull request for this. We’ll merge it to |
@ifrins Well... another pull request was already submitted with the Everyone can now test the Xcode 13 support with the |
Added an optional closure parameter that can be invoked when the user wants to open the cocoapods URL, rather than using UIApplication.
This is needed in situations where the view controller lives in a framework target that doesn't allow UIApplication to be used.