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

Paddings -> offsets #10

Open
zdnk opened this issue Oct 13, 2015 · 3 comments
Open

Paddings -> offsets #10

zdnk opened this issue Oct 13, 2015 · 3 comments

Comments

@zdnk
Copy link

zdnk commented Oct 13, 2015

Wouldnt it be fitting to refactor xPad: CGFloat, yPad: CGFloat type arguments to something nice like offset: CGSize and/or offset: UIEdgeInsets. Seems a bit nicer to me, or at least provide it as overloads to current implementation :)

@mamaral
Copy link
Owner

mamaral commented Oct 13, 2015

Similar to my other comment on your other issue, this would complicate the implementation and usage of these methods, and make what they do slightly ambiguous and/or superfluous. Each method has a specific combination of parameters that apply specifically to each case, i.e. when anchoring to an edge, only yPad is required and makes sense, whereas a corner requires both an x and a y padding.

@zdnk
Copy link
Author

zdnk commented Oct 13, 2015

Ok, what I actually dont like is the "Pad" suffix. I would make it yOffset and xOffset or at least yPadding and xPadding. You can still use xPad and yPad in method implementation, but using abbreviated version seems just wrong in swift or objc. Offsets seem a bit better since it is used thru iOS and OS X SDKs extensively.

@mamaral
Copy link
Owner

mamaral commented Oct 13, 2015

Yeah I don't disagree there - with these things I'm always struggling a bit to find the balance between succinctness, clarity, explicitness, etc. I'll think some more about this and get back to you. Thanks!

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

2 participants