Skip to content

deda9/EasyCartography

Repository files navigation

EasyCartography

It's just a middleware for Cartography framework to wrap the cartography code to simple syntax

in Cartography, you can set width = 100 & height = 100 by

constrain(view) { view in
    view.width  == 100
    view.height == 100
}

but by easyCartography, you can write this syntax

view.setConstraint(.width(100) + .height(100))

and in Cartography, you can center the view in the superView by

constrain(view, self) { view, superView in
    view.center == superView.center
}

but by easyCartography, you can write this syntax:

view.center(in: self)

Cartography

constrain(view, self) { view, superView in
    view.left == superView.left + 20
}

EasyCartography

view.left(of: self, offset: 20)

Cartography

constrain(view, button) { view, button in
    view.centerX == button.centerX + 20
}

EasyCartography

view.centerX(in: button, offset: 20)