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

Add a polyfill for Objective-C to select TZStackView only when UIStackView is Unavailable #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fbartho
Copy link

@fbartho fbartho commented Nov 25, 2015

This messes with xcode's preprocessor and the Objective-C runtime so that you as a developer can just write UIStackView, and not worry about the fact that TZStackView is used under the hood when you're on older-iOS Versions.

Then when you're ready to drop iOS 8.x, you can just delete TZStackView and none of the rest of your code will need to change.

@thunky-monk
Copy link

👍

@kdubb
Copy link

kdubb commented Dec 1, 2015

Have you looked at my PR #47? It uses an (arguably) better method that allows things like NSClassFromString("UIStackView") to work as well. It's a well defined trick pioneered by the PSTCollectionView folks.

It also aligns the enums with their UIKit counterparts as well.

@kdubb
Copy link

kdubb commented Dec 1, 2015

It seems @CosynPa, @fbartho, @andi357 & myself all have a vested interested in 100% iOS 8 compatibility and, some of us, want automatic support for interface builder; not to mention some level of iOS 7 compatibility.

Should figure out how to work together because we all seem to be reinventing some portion of the same wheel.

@fbartho
Copy link
Author

fbartho commented Dec 1, 2015

I saw your PR @kdubb, and also PSTCollectionView's solutions to the Polyfill problem, but pulling in Assembly code was simply a non-starter with our existing shipping app and Engineering culture. (as an aside: does your assembly work with bitcode?). With the Preprocessor & alloc-override based solution from this PR we were able to convince the necessary parties to even start using StackViews at all.

iOS 7: When we started considering TZStackView, iOS 7 support was a requirement from on-high, but we successfully convinced them to drop it for new versions as the userbase numbers didn't justify it. This was overcome before the experimental branch with TZStackView was ready to undergo testing, so, now I'm neutral / don't require iOS 7 support.

Storyboards: Finally, we don't use Storyboards, the lack of Storyboard integration was an indifferent/neutral point for my team, but of course I support no-compromise solutions to that integration.

@kdubb
Copy link

kdubb commented Dec 1, 2015

After researching it a bit more I think there is a simpler solution using the mach-o library, thereby removing the assembly requirement. This would make it compatible with bitcode as well (not sure if assembly kills bitcode but it sure seems like it could).

@CosynPa
Copy link

CosynPa commented Dec 1, 2015

It it never guaranteed that a TZStackView has exactly the same behavior as a UIStackView. I think using UIStackView in iOS 9 and replacing it with TZStackView prior to iOS 8 is dangerous. And your approach would become very confusing if both Objective-C and Swift were used.

@CosynPa
Copy link

CosynPa commented Dec 1, 2015

@fbartho iOS 7 support is broken by a careless pull request #37 , and is already fixed by me #59 . I think TZStackView, as a library, should support iOS 7.

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.

4 participants