-
Notifications
You must be signed in to change notification settings - Fork 265
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
NavController issue and switching to normal VC #68
Comments
I have one more question I d like to ask here. |
Apologies that I was just now able to get to this.
And for your last question: You want to call 'setDrawerPosition' on the Pulley VC when you want to do this. If your view controllers have a reference to Pulley, you can invoke it on that. If you don't have a reference, you can obtain a reference to Pulley from within your drawer view controller or main content view controller (assuming they're directly in Pulley, no navigation / etc in the middle) by doing this: |
Thanks for your help. It all worked out. But I did explain the second problem wrongly sorry. I changed the view controller structure just like you said and the BarDetailVC appears just like I told you I want to. But is it possible to make the BarDetailVC to still remain inside the drawer but the next upcoming view to be not inside the drawer ? Do I have to use the setDrawerContentViewController Method inside a prepare for segue func ? How do I have to use it if ? |
You can put a navigation controller as the drawer content VC, if you want, and do it that way. But, you'll need to find a way to route pushes back to the navigation controller containing Pulley VC for when you don't want to show it in the drawer. You can also use setDrawerContentViewController, which would be easier. If you want to use this method, you'll need to manually create your view controller instance and then pass it to that method. |
yes I think thats the best option hence BarDetailVC is the only additional VC i want to present inside the drawer. But do I have to write it inside the DrawerContentVC class or the BarDetailVC class ? If its inside DrawerContentVC do I have to put it inside a prepare for segue class that it doesn't get called to early ? |
Your drawer content vc would call it, and pass it the bar detail VC instance. If you need to go 'back', you'd do the opposite. You can't do it as a segue, so you'll need to do this in code. |
You don't want to implement that method, instead you want to call it on the Pulley vc. So, wherever you want this to happen (didSelectRow, or a button press action, etc.) try this (assuming your drawer content VC isn't in a navigation controller):
Note: If your view controller is loaded from a Storyboard or xib file, make sure you instantiate it the correct way...if that's the case, just loading it with the default initializer like that probably won't work. |
yes i had to instantiate it. :) I made the Navigationbar hidden for the DrawerContentVC but for the BarDetailVC i called |
That only shows if your view controller is pushed in a navigation controller. Since you're directly setting the drawer content VC of Pulley (not pushing it in a navigation controller) you won't have a back button provided for you. You'll need to work with a navigation controller as your drawer view controller and push within that, or add your own back button in your Detail VC. |
Ok i got it thanks for all the help. Thanks ! |
It should work the same. What error do you get when it crashes? |
Well its a really long text inside the console... ERROR!! But the AVCaptureMetadataOutput method has nothing to do with these VCs its part of the QRScanner from the other tab. I don't know why this is written there |
It sounds like your Storyboard instantiation line is instantiating your QRScanner, somehow / somewhere. |
Well i deleted everything and just repeated and now it works thank you anyway 👍 |
Thanks! Glad it worked! |
Hello, in the picture below you can see how I build up the drawer content in the storyboard. What you can't see is that the pulleyVC is also embed in a tabbarcontroller.
I have now 2 problems with the results of this, I don't know how to fix.
The text was updated successfully, but these errors were encountered: