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

OAStackViewProxy #87

Merged
merged 6 commits into from
May 5, 2016
Merged

Conversation

joemasilotti
Copy link
Contributor

This PR enables developers to use a single API when dealing with stack views. OAStackViewProxy wraps a UIStackView on iOS 9 and an OAStackVew on any older OS version.

Each method call takes advantage of Swift's build in #avaiable API to determine which stack view to use under the hood. Each property is exposed on the proxy with OAStackView's enum types. The proxy also takes advantage of Swift's didSet to update properties on the stack views.

I updated the example app to use the proxy over an OAStackView directly. This means we don't have to modify the tests because we are already using the class. However, this is only the case on iOS 8. Running the tests on iOS 9 will just use a wrapped UIStackView.

One caveat to this approach is that the target application needs to import <OAStackView/OAStackView-Swift.h> to use the proxy. I also had to enable CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES to successfully build the module. Perhaps someone with more experience in building frameworks can lend a hand here.

Note: Storyboards are not supported.

This PR was inspired by @natanrolnik's work on #32.

@nsomar
Copy link
Owner

nsomar commented May 5, 2016

Hey super cool PR thanks. 👍

@nsomar nsomar merged commit 3ba6935 into nsomar:master May 5, 2016
@joemasilotti joemasilotti deleted the OAStackViewProxy-Swift branch May 5, 2016 16:39
@nikolaykasyanov
Copy link
Contributor

Wouldn't this compromise iOS 7 compatibility? I mean, CocoaPods requires frameworks and hence iOS 8+ deployment target for dependencies with Swift code.

@paleozogt paleozogt mentioned this pull request Jan 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants