Augustyniak / FileExplorer

FileExplorer is a powerful iOS file browser that allows its users to choose and remove files and/or directories
Other
742 stars 112 forks source link

Change public to open so SpecificationProviders can be subclassed #27

Open mstralka opened 7 years ago

mstralka commented 7 years ago

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