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

I can't trigger to open left or right side by button action. #29

Open
GokmenAkar opened this issue May 29, 2018 · 7 comments
Open

I can't trigger to open left or right side by button action. #29

GokmenAkar opened this issue May 29, 2018 · 7 comments

Comments

@GokmenAkar
Copy link

GokmenAkar commented May 29, 2018

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)
        }
@kawoou
Copy link
Owner

kawoou commented May 30, 2018

What version are you using?

@GokmenAkar
Copy link
Author

GokmenAkar commented May 30, 2018

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

@kawoou
Copy link
Owner

kawoou commented Jun 1, 2018

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.

@neburzepol
Copy link

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?

@neburzepol
Copy link

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

@BeechMachine
Copy link

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.

@4bottiglie
Copy link

Just call self.drawerController?.openSide(.left, completion: nil), The completion: nil do the trick.

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

5 participants