I have an application where I am using SWreveal and I also have a bottomSheet in the front View controller. I have to open the view controller programmatically for the bottom sheet to work and the issue I have now is if I have a code like this
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)
everything works with the side drawer and i can toggle the view controllers but the bottomSheet does not work, passing it in like this, makes the bottoSheet work but if I click on the toggle button the app crashes
let storyboard = R.storyboard.baseSB()
let swVC = storyboard.instantiateViewController(withIdentifier: SWRevealViewController.className) as! SWRevealViewController
swVC.loadView()
storyboard.instantiateViewController(withIdentifier: HomeVC.className) as! HomeVC
let homeVC = swVC.frontViewController as! HomeVC
homeVC.mode = AppMode.go
let bottomSheetVC = BottomSheetVC(contentViewController: homeVC, 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)
how can I fix this so that the application works without a crash when I toggle the side view controller button