davdroman / Bohr

Settings screen composing framework
MIT License
1.26k stars 83 forks source link

Expose subclassing header files #44

Closed Argent closed 8 years ago

Argent commented 8 years ago

In order to be able to subclass BO-Cells properly when using the library as a framework (like for example with Carthage), the subclass-header files have to be public and added to the Bohr.h file

Changes:

davdroman commented 8 years ago

Subclass header files aren't supposed to be included with the main import <Bohr/Bohr.h> statement, but individually through #import <Bohr/BOTableViewCell+Subclass.h> or #import <Bohr/BOTextTableViewCell+Subclass.h>. This is done so that no subclassing-related methods or properties are exposed directly, to be kept only as implementation details.

Argent commented 8 years ago

Thanks for your response. Did you ever try that when using the library as a framework with carthage or a manual build? It works when I try to import the library with cocoapods, but when I use it in a carthage project, I get the following error when I add the import statement #import <Bohr/BOTableViewCell+Subclass.h:

.../Carthage/Build/iOS/Bohr.framework/PrivateHeaders/BOTableViewCell+Subclass.h:9:9: error: 'BOTableViewCell.h' file not found
#import "BOTableViewCell.h"

Besides, importing a specific header file only works for objective-c files. It is not possible for swift projects, there you would need at least a objective-c bridging header.

I think if you want your library to be extendable through subclassing, all the relevant methods should be publicly exposed

davdroman commented 8 years ago

You're totally right about the Swift part. Merging :+1: