-
-
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
ref #623 - add SwiftUI example #635
ref #623 - add SwiftUI example #635
Conversation
I see some checks here are failing. I'm pretty sure this has to do with me setting the example target to iOS 13, without it, the SwiftUI previews would not work. |
you can use if #available(iOS 13.0, *) instead of change iOS Target |
@iDevid on it 👌 |
…e still works (in simulator)
Ok, I've made the suggested change. However like I mentioned earlier, the downside of this is that the SwiftUI previews won't show within Xcode using this approach. In order to make the previews show, the target has to (temporarily) be set to iOS 13 + |
I think that's okay, normally we won't use SwiftUI with UIKit anyway. |
Cool, will leave it like this then. Regarding the failing tests, I don’t know how I’d have to resolve them since everything seemed to just work on my machine... |
@@ -0,0 +1,90 @@ | |||
import UIKit | |||
import SwiftUI |
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.
Can you wrap this while class in,
#if canImport(SwiftUI)
...
#endif
So that persons using older versions of XCode don't receive build errors.
You may need to wrap other code in the same block if they reference these classes.
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.
Sure, will do that tomorrow 👌
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.
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.
Ok, that last check is fixed now. Clueless on how to improve this code now. Looking forward to hearing an update from you @JoeMatt
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.
@JoeMatt do you have any updates for me on how we can get this merged?
…ftUI)` statement
…iewController and readability of tuple
/rebase |
Tested and merged externally of github #9631cb96fde7a0045422647fc1ec8481df968bd1 |
Adds example which shows how to use Hero in combination with SwiftUI, like asked for in #623.