Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added BTClientMetadata to public headers in order to make Braintree work with swift #84

Closed
wants to merge 1 commit into from
Closed

Added BTClientMetadata to public headers in order to make Braintree work with swift #84

wants to merge 1 commit into from

Conversation

Reflejo
Copy link
Contributor

@Reflejo Reflejo commented Feb 9, 2015

This small change makes Braintree compatible with swift and the new cocoapods' framework support.

@mickeyreiss
Copy link
Contributor

Thanks for the PR. Do you have any insight as to why only this private header is needed for swift support but no others? Is there any other way to add compatibility without marking this file as part of the public API?

@Reflejo
Copy link
Contributor Author

Reflejo commented Feb 9, 2015

@mickeyreiss BTClient_Metadata is importing BTClientMetadata.h as a quoted header and exposing a "metadata" property on the BTClient class publicly. The problem is that BTClientMetadata is not in the scope of Braintree's public headers. Sadly you can't include quoted headers inside your public headers that are not by itself public. Three options arise here:

a) Make BTClientMetadata.h public
b) Make BTClient_Metadata.h private (not sure if that is an option).
c) Import BTClientMetadata.h using a system import as in: #import <Braintree/BTClientMetadata.h> instead of as a quoted header.

@mickeyreiss
Copy link
Contributor

Interesting. I don't see BTClientMetadata as public anywhere. It is intended to be private.

The BTClient metadata property is declared in BTClient_Metadata.h, which is only imported by .m files.

Are interface extensions treated as "public" by the swift compiler even if they are not located in (or imported into) a public header?

Edit: BTClient_Metadata -> BTClientMetadata in the first sentence.

@Reflejo
Copy link
Contributor Author

Reflejo commented Feb 9, 2015

@mickeyreiss BTClient_Metadata is public, The file is actually here: ./Braintree/API/@Public/BTClient_Metadata.h which is included as public in the podspecs: s.public_header_files = "Braintree/API/@Public/*.h"

@mickeyreiss
Copy link
Contributor

@Reflejo Ahh - that explains it. I believe that is a mistake, and I think the best solution would be to move BTClient_Metadata.h out of the @Public directory.

@mickeyreiss
Copy link
Contributor

I'm working on another PR to make that change right now.

@Reflejo
Copy link
Contributor Author

Reflejo commented Feb 10, 2015

Closed in favor of #85

@mickeyreiss
Copy link
Contributor

Thanks for helping us iron this one out, @Reflejo!

mickeyreiss added a commit to mickeyreiss/braintree_ios that referenced this pull request Feb 13, 2015
…d-of-file

Add a new-line at the end of every file to support merchant integrations with GCC_WARN_ABOUT_MISSING_NEWLINE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants