haojianzong / ObjectForm

A simple yet powerful Swift library to build form for your class models.
Apache License 2.0
177 stars 14 forks source link

Row classes cannot be subclassed when installing with the Swift Package Manager #13

Closed RobertAudi closed 4 years ago

RobertAudi commented 4 years ago

When trying to subclass a row class Xcode throws an error:

class CustomRow: BaseRow { /* */ }
// Error: Cannot inherit from non-open class 'BaseRow' outside of its defining module

This is because the row classes are defined as public instead of open.

The problem shouldn't exist when the source files are dragged into a project though.

haojianzong commented 4 years ago

Thanks for bringing this up @RobertAudi

I will update.

haojianzong commented 4 years ago

15 addresses subclassing. I've made BaseRow and FormInputCell open and keep other rows and cells public because I think inheritance will make the code harder to maintain both for this repo and the caller application. Please check the readme.md change here.