Skip to content
This repository has been archived by the owner on Aug 24, 2020. It is now read-only.

Expose subclassing header files #44

Merged
merged 1 commit into from
Feb 22, 2016
Merged

Conversation

Argent
Copy link
Contributor

@Argent Argent commented Feb 12, 2016

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:

  • Changed visibilty of BOTableViewCell+Subclass.h, BOTextTableViewCell+Subclass.h and BOSetting.h to public
  • Added BOTableViewCell+Subclass.h and BOTextTableViewCell+Subclass.h to Bohr.h

- Changed visibilty of `BOTableViewCell+Subclass.h`,  `BOTextTableViewCell+Subclass.h` and `BOSetting.h` to public
- Added `BOTableViewCell+Subclass.h` and `BOTextTableViewCell+Subclass.h` to Bohr.h
@davdroman
Copy link
Owner

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
Copy link
Contributor Author

Argent commented Feb 17, 2016

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
Copy link
Owner

You're totally right about the Swift part. Merging 👍

davdroman pushed a commit that referenced this pull request Feb 22, 2016
Expose subclassing header files
@davdroman davdroman merged commit 883ac77 into davdroman:master Feb 22, 2016
@Argent Argent deleted the subclassing branch February 23, 2016 08:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants