Neon icon indicating copy to clipboard operation
Neon copied to clipboard

Paddings -> offsets

Open zdnk opened this issue 9 years ago • 3 comments

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 :)

zdnk avatar Oct 13 '15 13:10 zdnk

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.

mamaral avatar Oct 13 '15 14:10 mamaral

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.

zdnk avatar Oct 13 '15 14:10 zdnk

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!

mamaral avatar Oct 13 '15 14:10 mamaral