You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm attempting to utilize a custom FileSpecificationProvider to display .txt files in a certain format, however the FileExplorerViewController brings up the UknownFileTypeViewController instead.
class FileViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let fileExplorer = FileExplorerViewController()
fileExplorer.delegate = self as? FileExplorerViewControllerDelegate
fileExplorer.fileSpecificationProviders = [TXTSpecificationProvider.self]
self.present(fileExplorer, animated: true, completion: nil)
}
}
public class TXTSpecificationProvider: FileSpecificationProvider {
public class var extensions: [String] {
return ["txt"]
}
public static func thumbnail(forItemAt url: URL, with size: CGSize) -> UIImage? {
return nil
}
public class func viewControllerForItem(at url: URL, data: Data?, attributes: FileAttributes) -> UIViewController {
return ThisPlacePreviewViewController(fileName: url.absoluteString)
}
}
The text was updated successfully, but these errors were encountered:
I'm attempting to utilize a custom FileSpecificationProvider to display .txt files in a certain format, however the FileExplorerViewController brings up the UknownFileTypeViewController instead.
The text was updated successfully, but these errors were encountered: