Skip to content

Instantly share code, notes, and snippets.

@nicksnyder
Last active June 28, 2016 17:34
Show Gist options
  • Save nicksnyder/cc5b7d36ac9f387894ada87e5151920c to your computer and use it in GitHub Desktop.
Save nicksnyder/cc5b7d36ac9f387894ada87e5151920c to your computer and use it in GitHub Desktop.
import LayoutKit
/// A simple hello world layout using LayoutKit.
public class HelloWorldLayout: InsetLayout {
public init() {
super.init(
insets: UIEdgeInsets(top: 4, left: 4, bottom: 4, right: 8),
sublayout: StackLayout(
axis: .horizontal,
spacing: 4,
sublayouts: [
SizeLayout<UIImageView>(width: 50, height: 50, config: { imageView in
imageView.image = UIImage(named: "earth.png")
}),
LabelLayout(text: "Hello World!", alignment: .center)
]
)
)
}
}
helloWorld.arrangement().makeViews(inView: rootView)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment