PageMenu / PageMenu

A paging menu controller built from other view controllers placed inside a scroll view (like Spotify, Windows Phone, Instagram)
BSD 3-Clause "New" or "Revised" License
5.27k stars 899 forks source link

How to move viewcontroller? #385

Open aboutyu opened 7 years ago

aboutyu commented 7 years ago

Hi, I have a question. I have made collectionview to xib, but I can't move parent viewcontroller (viewcontroller is navigationcontroller)

It is calling to "move function" from xib. ("move function" is written to viewcontroller) but self.navigationController is returned nil.

How to make it? Move function is here.

func moveDetailView(str: String) {

    let sb = UIStoryboard(name: "Main", bundle: nil)
    if let uvc = sb.instantiateViewController(withIdentifier: "ProductDetailViewController") as? ProductDetailViewController {

        uvc.linkUrl = str

        //var rt =
        //var rootViewController = self.window!.rootViewController as! UINavigationController

        //let nv = UINavigationController()

        //nv.pushViewController(uvc, animated: true)

        self.navigationController?.pushViewController(uvc, animated: true)

        print("success \(UINavigationController())")
    }
jjpatel1996 commented 6 years ago

collectionview which you using is child view of pagMenu right?