Parchment
Parchment copied to clipboard
Crash when init()
Hello, everyone.
I use Parchment in my custom view controller, but it's crash when init().
Parchment version: 3.0.1
Error message is: " Fatal error: Use of unimplemented initializer 'init(nibName:bundle:)' for class 'Parchment.PagingViewController' "
Here is my code:
class ParchmentViewController: UIViewController {
var pagingViewController = PagingViewController()
override func viewDidLoad() {
super.viewDidLoad()
pagingViewController.delegate = self
pagingViewController.dataSource = self
}
}
extension ParchmentViewController: PagingViewControllerDelegate {
...
}
extension ParchmentViewController: PagingViewControllerDataSource {
...
}
I don't know what happened. Please help me, thanks.
try calling init with options
let pagingViewController = PagingViewController(options: PagingOptions())
Looks like you are trying to initialise it using the init(nibName:bundle:)
initialiser. You either need to initialize it from a storyboard or using the default init(options:)
initializer.