Open AdieOlami opened 5 years ago
Have you implemented this in the primary content view controller or drawer view controller?
If you’re implementing this elsewhere you’ll need to assign that object to the delegate property of Pulley.
How please?
PulleyViewController has a delegate property. Assign the object you want to be the delegate to that property.
Yes, that’s why I extended the viewcontroller as shown in my question
Adding the delegate extension to a view controller doesn’t make it automatically receive delegate events. It must also be assigned to the delegate property.
If your view controller is your primary content view controller or drawer view controller you’ll need to ensure it uses the appropriate delegate for that view controller (primary vs drawer), it won’t work if you don’t implement the correct one.
If your view controller is your primary content view controller or drawer view controller and it’s contained in a navigation controller (or tab bar controller) you’ll need to proxy the delegate methods through that controller.
I am implementing the correct one. I am lost and confused.
This is the way I am opening up and setting the buttomsheet
let storyboard = R.storyboard.baseSB()
let swVC = storyboard.instantiateViewController(withIdentifier: SWRevealViewController.className) as! SWRevealViewController
swVC.loadView()
let homeVC = swVC.frontViewController as! HomeVC
homeVC.mode = AppMode.go
let bottomSheetVC = BottomSheetVC(contentViewController: swVC, drawerViewController: UIViewController())
bottomSheetVC.drawerCornerRadius = 0
bottomSheetVC.initialDrawerPosition = .closed
bottomSheetVC.shadowRadius = 0
bottomSheetVC.shadowOpacity = 0
homeVC.bottomDrawer = bottomSheetVC
bottomSheetVC.modalTransitionStyle = .crossDissolve
self?.present(bottomSheetVC, animated: true, completion: nil)
Any thing I am not implementing?
I have discovered the problem but solving it is what I do not know currently.so because I am using SWRevealController to show a side navigation menu, I do not know how to make the home controller the main controller
First, I don’t support subclasses of Pulley as it can introduce issues. Please use PulleyViewController as-is.
It looks like your issue is that you’ve made the 2 things try to contain each other.
I’m not aware of how the slide to reveal library you’re using works, however you generally want to set it up like this:
Your window’s root view controller (or modally presented controller) should be the swipe to reveal controller, the swipe to reveal controller should contain PulleyViewController as one if it’s view controllers. Pulley must be initialized with a primary and drawer view controller that ARE NOT the swipe to reveal controller (or anything it manages).
Think of it as building in layers. You can’t use a layer twice. Right now you’re using a layer twice: You’re having pulley try to contain the swipe to reveal controller AND having the swipe to reveal controller contain Pulley. That won’t work.
If you don’t want Pulley to be IN the swipe to reveal controller, and instead want the swipe to reveal controller to live inside Pulley:
Pulley should be the root view controller of the window (or modally presented) and the primary content view controller should be the swipe to reveal view controller. The swipe to reveal controller can then contain a bottom / front VC as needed, neither of which is Pulley. IMPORTANT: In this case, the swipe to reveal controller IS the primary view controller, so that’s where the delegate events will be delivered. You’ll have to implement the delegate on that class. Most people choose to forward the delegate events on to the front controller in their implementation.
There’s limited support I can provide for your use of 3rd party libraries. I can assist directly with Pulley, but am unable to generally assist with issues related to involving other libraries in the mix.
Awesome Library
I extended the pulley delegate and printed a value for everytime the BottomSheet changes from either collapsed to open but the delegate method does not work. I do not know why?
I would really appreciate a response.