Closed BasThomas closed 8 years ago
eg.
import LeeGo let titleBrick: Brick = "title".build(UILabel).style([.text("Showcase"), .backgroundColor(UIColor.lightGrayColor())])
could become
import LeeGo let titleBrick: Brick = "title".build(UILabel).style([.text("Showcase"), .backgroundColor(.lightGrayColor())])
and
let bricks = ["red".build().style(Style.redBlockStyle).height(50), "green".build().style(Style.greenBlockStyle).height(80), "blue".build().style(Style.blueBlockStyle).height(30)] let layout = Layout(bricks: bricks, axis: .Horizontal, align: .Top, distribution: .FillEqually, metrics: LayoutMetrics(10, 10, 10, 10, 10, 10)) let viewBrick = "view".build().style(Style.blocksStyle).bricks(bricks, layout: layout).height(100)
let bricks = ["red".build().style(.redBlockStyle).height(50), "green".build().style(.greenBlockStyle).height(80), "blue".build().style(.blueBlockStyle).height(30)] let layout = Layout(bricks: bricks, axis: .Horizontal, align: .Top, distribution: .FillEqually, metrics: LayoutMetrics(10, 10, 10, 10, 10, 10)) let viewBrick = "view".build().style(.blocksStyle).bricks(bricks, layout: layout).height(100)
But I understand if this was done intentionally; it is clearer and more easily readable (?) in the examples.
If this wasn't done deliberately, I'd gladly help using implicit type inference. :)
Thank you for letting me know.
No, it's not intentionally. You are right, we may get rid of UIColor and take advantage from implicit type inference. Unfortunately it won't work for Style 😔.
UIColor
Style
eg.
could become
and
could become
But I understand if this was done intentionally; it is clearer and more easily readable (?) in the examples.
If this wasn't done deliberately, I'd gladly help using implicit type inference. :)