-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Enables application extension API only #557
Enables application extension API only #557
Conversation
Still maintained? |
duplicate #601 , maybe this is a better solution though |
@@ -324,7 +324,9 @@ public extension HeroExtension where Base: UIViewController { | |||
parentVC.present(next, animated: false, completion: completion) | |||
} | |||
} else { | |||
#if TARGET_IS_EXTENSION |
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.
Maybe should be ?
#if TARGET_IS_EXTENSION | |
#if !TARGET_IS_EXTENSION |
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.
No, this is correct. If you are in an extension UIApplication.shared
in unavailable
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.
Exactly, this if is calling the following line using UIApplication.shared
is it IS an extension.
My change is the inverse, only if it's NOT an extension, unless I'm drunk?
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.
This code is problematic either way. I think it's not the correct conditional check. It either always or never disables this block of code despite how I flip the extension setting. Need to dig into a better solution. Supringly hard to find.
I made a new PR to solve other issues #681
Adds support for using Hero in application extension.
Due to two workarounds which use
Application.shared
, which is unavailable inside of extension we needed do insert conditional compile mark. We hope this works and would like to get some feedback.