Unbalanced calls to begin/end appearance transitio

2019-09-19 02:12发布

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.

2条回答
何必那么认真
2楼-- · 2019-09-19 02:34

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(_:))) })
查看更多
我想做一个坏孩纸
3楼-- · 2019-09-19 02:37

Did you delete main.m file?If you didn't have an application begin,you will get this.

查看更多
登录 后发表回答