With introduction of open
keyword in Swift 3.0 (What is the \'open\' keyword in Swift?).
Note: Limited to extensions on NSObject
derived classes
Unless I am mistaken, you can declare the extension methods as
open
in your framework if you just omit the public
keyword
in the extension declaration:
extension UIManagedDocument {
open class func primaryDocumentName() -> String {
return "Document"
}
// ...
}
And then (for NSObject
subclasses or @objc
members) you can override the method
in your custom subclass in the main application (or in any module):
class MyManagedDocument: UIManagedDocument {
override class func primaryDocumentName() -> String {
return "MyDocument"
}
// ...
}