Skip to content

Instantly share code, notes, and snippets.

@haldun
Created October 22, 2015 08:52
Show Gist options
  • Save haldun/e19d67a5e6189e32e82d to your computer and use it in GitHub Desktop.
Save haldun/e19d67a5e6189e32e82d to your computer and use it in GitHub Desktop.
protocol Placeable {}
enum LayoutElement {
case ContainerElement(Container)
case Item(Placeable)
}
struct Container {
let items: [LayoutElement]
}
struct Text {
let title: String
}
extension Text: Placeable {}
// Example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment