Well, i need the size a element in swift. Bat this...
let screenSize: CGRect = UIScreen.mainScreen().bounds
// 560.0 414.0
+ Grid.leading = leadingMargin
+ Grid.bottom = Bottom Layout Guide.top
+ Grid.top = top
+ Grid.trailing = leadingMargin
Your question is very vague but here is what I see:
leadingMargin? Shouldn't it be
When using autolayout, frames do not automatically have their correct size, try adding this code before accessing a frame dimensions:
This way, an autolayout pass is forced, allowing the frames to be set.