FileExplorer
FileExplorer copied to clipboard
Change public to open so SpecificationProviders can be subclassed
My swift 3.0 app uses PSPDFKit to render PDF files, so I want to implement a subclass of PDFSpecificationProvider
that will do this:
class MLPDFSpecificationProvider: PDFSpecificationProvider {
public class func viewControllerForItem(at url: URL, data: Data?, attributes: FileAttributes) -> UIViewController {
let document = PSPDFDocument(url: url)
let controller = PDFViewController(document: document, configuration: PSPDFConfiguration { builder in
builder.useParentNavigationBar = true
})
return controller
}
}
I want to continue using PDFSpecificationProvider for generating the thumbnail.
When I build, I get this error:
cannot inherit from non-open class outside of its defining module
According to this stackoverflow post, the public
modifier on PDFSpecificationProvider
should be changed to open
to make this work in Swift 3.
Would it be possible for you to make this change so your classes can be subclassed?
Thanks Mark