Fixing presentation bug

This commit is contained in:
Roy Marmelstein
2016-02-16 01:24:27 +01:00
parent bdc34220a7
commit f3d8024cb6
+12 -1
View File
@@ -45,7 +45,7 @@ class PreviewManager: NSObject, QLPreviewControllerDataSource {
var filePath: NSURL?
func previewViewControllerForFile(file: FBFile) -> UIViewController {
let quickLook = QLPreviewController()
let quickLook = FilePreviewController()
quickLook.dataSource = self
self.filePath = file.filePath
return quickLook
@@ -65,6 +65,17 @@ class PreviewManager: NSObject, QLPreviewControllerDataSource {
}
/// Subclassing QLPreviewController to override presentingViewController and fix unbalanced calls for presentation.
class FilePreviewController: QLPreviewController {
override var presentingViewController: UIViewController? {
get {
return nil
}
}
}
class PreviewItem: NSObject, QLPreviewItem {
var filePath: NSURL?