Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR enables developers to use a single API when dealing with stack views.
OAStackViewProxy
wraps aUIStackView
on iOS 9 and anOAStackVew
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 withOAStackView
's enum types. The proxy also takes advantage of Swift'sdidSet
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 wrappedUIStackView
.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 enableCLANG_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.