KWDrawerController
KWDrawerController copied to clipboard
I can't trigger to open left or right side by button action.
I followed instructions for storyboard and I set controllers correctly.
class Example: UIViewController, DrawerControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
self.drawerController?.delegate = self
self.drawerController?.options.isAnimation = false
self.drawerController?.setTransition(DrawerFloatTransition(), for: .left)
}
When I try to trigger open left side with this code block, drawerController throws nil error and crash.
if self.drawerController!.drawerSide == .none {
self.drawerController?.openSide(.left)
.subscribe()
.disposed(by: disposeBag)
} else {
self.drawerController?.closeSide()
.subscribe()
.disposed(by: disposeBag)
}
What version are you using?
@kawoou Xcode Version: Version 9.3.1 Swift Version: 4.1 Pods:
- RxCocoa (4.1.2):
- RxSwift (~> 4.0)
- RxSwift (4.1.2)
- KWDrawerController (4.1.6):
- KWDrawerController/Core (= 4.1.6)
- KWDrawerController/Core (4.1.6)
What class is calling the code that calls openSide
method?
If this ViewController calling the self.drawerController
property does not have a DrawerController in its super, it will be nil.
I followed instructions for storyboard and I set controllers correctly.
class Example: UIViewController, DrawerControllerDelegate {
override func viewDidLoad() { super.viewDidLoad() self.drawerController?.delegate = self self.drawerController?.options.isAnimation = false self.drawerController?.setTransition(DrawerFloatTransition(), for: .left) }
When I try to trigger open left side with this code block, drawerController throws nil error and crash.
if self.drawerController!.drawerSide == .none { self.drawerController?.openSide(.left) .subscribe() .disposed(by: disposeBag) } else { self.drawerController?.closeSide() .subscribe() .disposed(by: disposeBag) }
I have the same problem, could you solve it?
I have the same problem, I follow the readme manual but I have the same crash, the self.drawerController is nil, any suggest?
best regards
Also having issues with self.drawerController?.openDrawer(.left)
and self.drawerController?.closeDrawer()
. In my case, both the left and centre have UINavigationContoller's embedded in them, each with a single UIViewController embedded as the rootViewController. Each has a left bar button item in the Navigation Bar that calls a private function that just calls the open or close. In both cases, the private function is getting called, but the DrawerController isn't responding. I've logged out the self.drawerController
, it's not nil. I've also setup my view controller as the DrawerControllerDelegate, none of the delegate methods are getting called. My DrawerController was setup in storyboard, just in case that's relevant.
Just call self.drawerController?.openSide(.left, completion: nil), The completion: nil do the trick.