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

SwiftUI Integration Issue #380

Open
sdevo619 opened this issue Mar 30, 2020 · 5 comments
Open

SwiftUI Integration Issue #380

sdevo619 opened this issue Mar 30, 2020 · 5 comments

Comments

@sdevo619
Copy link

image
I am running into this issue when using the Pulley controller, when transitioning from the root UIHostingController, which the primary view is embedded in a NavigationView, to the the pulleyViewcontroller, it keeps messing with the navigation buttons, any idea what I could do to fix this, because every solution so required to hide the nav but buttons and use UIButtons, but then at that point, it presents issues with Swipe to go back and the back button, not showing. I just need the nav buttons to move down, but if I try to add padding to them, they are not working, and I don't think you can add padding to the back button. Have already spent a ton of time, trying this every which way, and I know I must be missing about how the base PulleyController is created when done through code and not storyboards.

Do you have any suggestion on what I may need to do to fix this, as I don't want to ditch the PulleyContoller, as it has worked quite well up until this point??? Either way, thank you very much!!!

@amyleecodes
Copy link
Contributor

Pulley doesn’t touch navigation bars or navigation items. As a result, there’s not really anything that can be done. It’s something specific to your setup with SwiftUI.

My only suggestion to you would be to add PulleyViewController as a child view controller to another one you own where you have more controller over layout.

@sdevo619
Copy link
Author

sdevo619 commented Apr 1, 2020

Thank you very much for clarifying this and for the fast response. In eliminating this as a potential issue, you helped me figure out what was going on. The issue is a bug in SwiftUIs navigation, and has nothing to do with Pulley, but I found a workaround. I very much appreciate the help here. Best wishes to you. Stay healthy and safe!!!

@sdevo619
Copy link
Author

sdevo619 commented May 5, 2020

Hey, sorry to bug you again on this, but I have tried every single combination possible, but am still running into a ton of issues trying to navigate back from a pulley vc to my rootvc when embedding the pulleyvc in a UIViewControllerRepresentable. The back button appears to show just briefly as the vc loads and then it disappears. I need to go from a root vc with the nav bar hidden(which is hostingcontoller embedded in a NavigationController, and have tried without the root vc embedded in a nav controller too), then using a NavigationLink to push to the PulleyVC, which is being instantiated in code, inside the UIViewControllerRepresentable, and be able to swipe back to the main VC. Prior to SwiftUI I had been accomplishing this using a UIScreenEdgePanGesture, which worked, even if it was a bit of a hack. I have tried embedding the entire Pully contoller in a nav controller and I have tried to embed just the contentViewController of the PulleyController in a Navigation Controller but none of these options seemed to work properly as I inevitably always loose the back button at the top of the screen. How can I accomplish this kind of navigation style using Pulley?? What I believe might be happening, is that because the PulleyVC is being instantiated from code and not a storyboard, it doesn't have the proper height and navigation reference available to swipe back to, but the issue is that trying to instantiate a pulleyvc off the storyboard leads to all kinds of other issues, due to the issue with viewDidLoad and needing to use didSet. The didSet issues with pulley have cost me a crapload of time troubleshooting, and are likely going to be why I end up abandoning this framework, because it inevitably creates all kinds of additional bugs to troubleshoot as a result of this shortcoming of this framework. I would highly recommend finding a better way to do this going forward, because while it worked ok with Swift, it creates tons of problems in SwiftUI. If you have any suggestion on how I can make this work, without rewriting most of it, I would love to hear them, because after way too many hours now on this particular issue, I am about ready to dump this, and rewrite it all in SwiftUI. Please help if you can. Thank you!

@amyleecodes
Copy link
Contributor

amyleecodes commented May 5, 2020

This project was written years before SwiftUI, and has no intention of being compatible with SwiftUI.

If it worked at all, that’s was a happy accident. SwiftUI is still pretty buggy in general, and there’s currently no plan for this project to officially support it.

@haydgately
Copy link

@sdevo619 Would you be able to send an example project integrating with SwiftUI ? I am struggling to get it working at all, I know the developer has explained it isn't plug and play and wasn't built with SwiftUI in mind, but you originally said you had it working quite well at one point. Thanks!

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

No branches or pull requests

3 participants