Skip to content

calling moveToPage from another View Controller #63

@Jmandarino

Description

@Jmandarino

When I try to call moveToPage from another class it fails on this line:

let currentIndex = stackPageVC.index(of: currentStackVC)!

with the error:

fatal error: unexpectedly found nil while unwrapping an Optional value

here is my code:

//View controller where the call is started
@IBAction func buttonRightView(_ sender: Any) {
        let vc:ViewController = storyboard?.instantiateViewController(withIdentifier: "ViewController") as! ViewController
        vc.goRight()
    }
class ViewController: EZSwipeController {
    override func setupView() {
        datasource = self
        navigationBarShouldNotExist = true
    }
    func goRight(){
        moveToPage(1, animated: true)
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions