我正在为使用 Swift 制作的新应用程序使用第三方库。类/库的作者使用final
关键字将其设为 final,可能是为了优化和防止覆盖其属性和方法。
例子:
final public class ExampleClass {
// Properties and Methods here
}
我是否可以在不覆盖默认值的情况下扩展该类并向其添加一些新属性和方法?
像这样:
extension ExampleClass {
// New Properties and Methods inside
}