mamaral / Neon

A powerful Swift programmatic UI layout framework.
MIT License
4.58k stars 389 forks source link

Paddings -> offsets #10

Open zdnk opened 8 years ago

zdnk commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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!