Giter VIP home page Giter VIP logo

Comments (17)

alpa99 avatar alpa99 commented on May 14, 2024

I have one more question I d like to ask here.
My PrimaryContentVC contains a map and this map contains annotations. When the annotation view opens there is a detail button. I want by pressing this button to open the drawer vc in a partially revealed position. What do I have to write where ? Haha
Im sorry for this kind of question but its my first ever project :)

from pulley.

amyleecodes avatar amyleecodes commented on May 14, 2024

Apologies that I was just now able to get to this.

  1. That's expected. When you embed your Drawer Content VC in a navigation controller, and then assign the navigation controller as the drawer content in Pulley, the navigation controller is the drawer content VC from Pulley's point of view. You'll need to implement the delegate methods in a custom subclass of UINavigationController. You can write your subclass to forward these to the currently visible view controller in the navigation stack if you'd like, but that's an implementation detail left up to you.

  2. As you've seen a navigation push from inside the drawer will cause the new view controller to remain in the drawer. This is how navigation controllers work, which is expected. Any form of Modal presentation will hide the tabbar, so I'm assuming you want to do a navigation push. In that case, you want your view controller structure to look like this: Window.rootViewController -> UITabbarController -> UINavigationController -> Pulley -> Drawer / main content. This makes it so that when you 'push' to a new view controller, Pulley disappears. This will allow your tabbar to remain on top.

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: (parent as? PulleyViewController).setDrawerPosition(...).

from pulley.

alpa99 avatar alpa99 commented on May 14, 2024

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 ?

from pulley.

amyleecodes avatar amyleecodes commented on May 14, 2024

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.

from pulley.

alpa99 avatar alpa99 commented on May 14, 2024

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 ?

from pulley.

amyleecodes avatar amyleecodes commented on May 14, 2024

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.

from pulley.

alpa99 avatar alpa99 commented on May 14, 2024

bildschirmfoto 2017-08-21 um 23 33 33

I have inserted these lines inside the DrawerContentVC class but didn't change anything at all.

from pulley.

amyleecodes avatar amyleecodes commented on May 14, 2024

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):

 let detailVC = BarDetailVC()
 (parent as? PulleyViewController)?.setDrawerContentViewController(detailVC, animated: true)

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.

from pulley.

alpa99 avatar alpa99 commented on May 14, 2024

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. :)
But now the BarDetailVC doesn't have the navigation bar at top...
That means no Back button in the top left corner... what am i doing wrong ?

I made the Navigationbar hidden for the DrawerContentVC but for the BarDetailVC i called
self.navigationController?.setNavigationBarHidden(false, animated: true)
inside the viewWillAppear function

from pulley.

amyleecodes avatar amyleecodes commented on May 14, 2024

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.

from pulley.

alpa99 avatar alpa99 commented on May 14, 2024

Ok i got it thanks for all the help.
I think adding just an own back button should be enough here :)

Thanks !

from pulley.

alpa99 avatar alpa99 commented on May 14, 2024

bildschirmfoto 2017-08-22 um 00 17 18

Im sorry but I had to reopen this because I tried to add my own back button doing it like i did before but when i test it the app crashes. Shouldn't it work backwards the same way ?

from pulley.

amyleecodes avatar amyleecodes commented on May 14, 2024

It should work the same. What error do you get when it crashes?

from pulley.

alpa99 avatar alpa99 commented on May 14, 2024

Well its a really long text inside the console...
I think these lines might be helpful

ERROR!!
2017-08-22 00:11:53.708 testapp[66270:2482664] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[AVCaptureMetadataOutput setMetadataObjectTypes:] Unsupported type found - use -availableMetadataObjectTypes'
*** First throw call stack:

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

from pulley.

amyleecodes avatar amyleecodes commented on May 14, 2024

It sounds like your Storyboard instantiation line is instantiating your QRScanner, somehow / somewhere.

from pulley.

alpa99 avatar alpa99 commented on May 14, 2024

Well i deleted everything and just repeated and now it works thank you anyway 👍
You are doing great work
I appreciate it a lot !

from pulley.

amyleecodes avatar amyleecodes commented on May 14, 2024

Thanks! Glad it worked!

from pulley.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.