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

Non-prefixed extension properties on UIView feels gross #2

Open
bencochran opened this issue Feb 10, 2015 · 0 comments
Open

Non-prefixed extension properties on UIView feels gross #2

bencochran opened this issue Feb 10, 2015 · 0 comments

Comments

@bencochran
Copy link
Owner

Using such generic names in a extensions to UIView and UIViewController feels like recipe for disaster (naming conflicts later, in particular).

Possible ideas:

  • Prefix the properties (e.g. pno_left). But that’s less nice looking.
  • Wrap UIView in a proxy that defines the properties (in fact ComparableSubject could almost do that now… but ComparableSubject.View(view).left == ComparableSubject.View(label).left is very ugly)
  • Use the same proxy idea but somehow pass those into a block that the constraints are created in, Not sure the cleanest way to do this without resorting to a bunch of (UIView) -> [NSLayoutConstraint], (UIView, UIView) -> [NSLayoutConstraint], (UIView, UIView, UIView) -> [NSLayoutConstraint] permutations (variadic parameters have no way of helping as far as I can see)

I’m going to keep pondering solutions to this… (might just going with the prefix, as sad as it makes me)

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

No branches or pull requests

1 participant