SWRevealViewController from the right side on swift

前端 未结 6 2246
梦毁少年i
梦毁少年i 2021-02-20 05:28

I am using SWRevealViewController library to make a slide out menu in swift, but I am struggling to put this menu in the right side. I have seen on the library description this

6条回答
  •  被撕碎了的回忆
    2021-02-20 06:14

    Swift 3

    Add this code to yourViewController

    if revealViewController() != nil{
            sideMenuBtn.target = revealViewController()
            sideMenuBtn.action = #selector(SWRevealViewController.rightRevealToggle(_:))
            view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
        }
    

    at MainStoryBoard

    Set the segue identifier value to sw_right instead of sw_rear

    • Worked for me

    Better Alternative: https://github.com/jonkykong/SideMenu

提交回复
热议问题