Closed aksh1995a closed 6 years ago
and my root vc has a collection view so subclass of colviewcontroller and flowlayoutdele and I am not using storyboard
Can you check your test?
if (self.revealViewController() == nil){
It should be:
if (self.revealViewController() != nil){
yes it was going to else block I wanted to see what happens when the code runs so I changed the condition
should our home vc be necessarily a subclass of swreveal??
Your home vc must be the front view controller of SW.
if self.revealViewController() != nil {
let button1 = UIBarButtonItem(image: UIImage(named: "back"), style: .plain, target: self, action: #selector(SWRevealViewController.revealToggle(_:)))
self.navigationItem.leftBarButtonItem = button1
self.navigationController?.navigationBar.shadowImage = UIImage()
self.navigationController?.navigationBar.barTintColor = UIColor(red: 1.00, green: 1.00, blue: 1.00, alpha: 1)
self.navigationController?.navigationBar.isTranslucent = true
button1.target = self.revealViewController()
button1.action = #selector(SWRevealViewController.revealToggle(_:))
self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
}
else
{
print("swreveal nil")
}
I am getting swreveal nil in log why am I getting nil any idea?? now my class is a subclass of swreveal
sorry I found the issue in app delegate I set my root vc to sw now it returned non nil works fine!!Thanks
hello I am integrating swreveal to my swift project
and my vc is returning nil
if (self.revealViewController() == nil){ let button1 = UIBarButtonItem(image: UIImage(named: "back"), style: .plain, target: self, action: #selector(self.back)) self.navigationItem.leftBarButtonItem = button1 self.navigationController?.navigationBar.shadowImage = UIImage() self.navigationController?.navigationBar.barTintColor = UIColor(red: 1.00, green: 1.00, blue: 1.00, alpha: 1) self.navigationController?.navigationBar.isTranslucent = true
so I am not getting the back button and reveal is blocked
and I removed the condition and changed its width to
can u help me out why am I not getting my root view on the side instead a black view