|
@@ -35,6 +35,7 @@ class NCViewer: NSObject {
|
|
|
// PDF
|
|
|
if metadata.contentType == "application/pdf" {
|
|
|
|
|
|
+ if !canPush(viewController: viewController) { return }
|
|
|
guard let navigationController = viewController.navigationController else { return }
|
|
|
let viewController:NCViewerPDF = UIStoryboard(name: "NCViewerPDF", bundle: nil).instantiateInitialViewController() as! NCViewerPDF
|
|
|
|
|
@@ -45,20 +46,12 @@ class NCViewer: NSObject {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private func canPush(viewController: UIViewController) -> Bool {
|
|
|
+
|
|
|
+ if viewController is NCFiles || viewController is NCFavorite || viewController is NCOffline || viewController is NCRecent || viewController is NCFileViewInFolder {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ return false
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
-/*
|
|
|
- @objc func segueMetadata(_ metadata: tableMetadata) {
|
|
|
- if self.appDelegate.activeViewController is NCFiles {
|
|
|
- (self.appDelegate.activeViewController as! NCFiles).segue(metadata: metadata)
|
|
|
- } else if self.appDelegate.activeViewController is NCFavorite {
|
|
|
- (self.appDelegate.activeViewController as! NCFavorite).segue(metadata: metadata)
|
|
|
- } else if self.appDelegate.activeViewController is NCOffline {
|
|
|
- (self.appDelegate.activeViewController as! NCOffline).segue(metadata: metadata)
|
|
|
- } else if self.appDelegate.activeViewController is NCRecent {
|
|
|
- (self.appDelegate.activeViewController as! NCRecent).segue(metadata: metadata)
|
|
|
- } else if self.appDelegate.activeViewController is NCFileViewInFolder {
|
|
|
- (self.appDelegate.activeViewController as! NCFileViewInFolder).segue(metadata: metadata)
|
|
|
- }
|
|
|
- }
|
|
|
- */
|