0

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.

Lakshmi Reddy
  • 313
  • 5
  • 17

2 Answers2

0

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

Lumialxk
  • 6,239
  • 6
  • 24
  • 47
0

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(_:))) })
Jovan Stankovic
  • 4,661
  • 4
  • 27
  • 16