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

Enables application extension API only #557

Conversation

lightsprint09
Copy link
Contributor

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.

@lightsprint09
Copy link
Contributor Author

Still maintained?

@JoeMatt
Copy link
Collaborator

JoeMatt commented Oct 7, 2019

duplicate #601 , maybe this is a better solution though

@JoeMatt JoeMatt changed the base branch from master to develop October 7, 2019 23:31
@JoeMatt JoeMatt requested review from lkzhao and JoeMatt April 25, 2020 23:01
@@ -324,7 +324,9 @@ public extension HeroExtension where Base: UIViewController {
parentVC.present(next, animated: false, completion: completion)
}
} else {
#if TARGET_IS_EXTENSION
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe should be ?

Suggested change
#if TARGET_IS_EXTENSION
#if !TARGET_IS_EXTENSION

Copy link
Contributor Author

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

Copy link
Collaborator

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?

Copy link
Collaborator

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

@JoeMatt JoeMatt added this to the 1.6.0 milestone May 5, 2020
@JoeMatt JoeMatt closed this Jul 30, 2020
JoeMatt added a commit that referenced this pull request Feb 8, 2021
* Enables application extension API only

* Replace UIApp...leftToRight with Locale extension

For use in Extensions that don't support UIApp

Co-authored-by: Lukas Schmidt <lukas.la.schmidt@deutschebahn.com>
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.

2 participants