问题
When I am presenting a QLPreviewviewcontrolelr from my Viewcontroller, the runtime warning that appears in the log as
Unbalanced calls to begin/end appearance transitions for .
Can anyone please suggest me the solution to fix.
回答1:
Did you delete main.m file?If you didn't have an application begin,you will get this.
回答2:
This is clearly Apple bug. You can wrap preview controller into navigation controller and then present this navigation controller modally. This seems to work fine. Only then you'll have to dismiss it manually.
let picker = QLPreviewController()
picker.dataSource = self
picker.delegate = self
let navcon = UINavigationController(rootViewController: picker)
presentViewController(navcon, animated: true, completion: {
picker.navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .Done, target: self, action: #selector(MyViewController.dismiss(_:))) })
来源:https://stackoverflow.com/questions/33430440/unbalanced-calls-to-begin-end-appearance-transitions