Open Esqarrouth opened 9 years ago
hi, thanks ! you can use them for laying out your views manually for example, if you want align two views horizontally with 10px padding
let padding: CGFloat = 10
let viewW: CGFloat = (self.view.w - padding*3) / 2
let viewH: CGFloat = 50
let firstView = UIView(x: padding, y: padding, w: viewW, h: viewH)
self.view.addSubview(firstView)
let secondView = UIView(x: firstView.rightWithOffset(padding), y: padding, w: viewW, h: viewH)
self.view.addSubview(secondView)
I didn't understand it with your code but tested and it is perfectly thought out. http://prntscr.com/7sz6v7
Sorry to barrage you with questions but,
How do you use these?
public init(stringLiteral value: StringLiteralType) { self = CGPointFromString(value) }
public init(extendedGraphemeClusterLiteral value: StringLiteralType) { self = CGPointFromString(value) }
public init(unicodeScalarLiteral value: StringLiteralType) { self = CGPointFromString(value) }
normalizeValue convertNormalizedValue clamp aspectHeightForTargetAspectWidth aspectWidthForTargetAspectHeight
I am still wondering about these :)
Where do you use these methods? Thanks for the extensions