Skip to content

Instantly share code, notes, and snippets.

@wilmarvh
Forked from chriseidhof/LazyView.swift
Created April 19, 2023 07:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wilmarvh/561829dd11563b4a3e413d8c4ccf303b to your computer and use it in GitHub Desktop.
Save wilmarvh/561829dd11563b4a3e413d8c4ccf303b to your computer and use it in GitHub Desktop.
LazyView
struct LazyView<Content: View>: View {
let build: () -> Content
init(_ build: @autoclosure @escaping () -> Content) {
self.build = build
}
var body: Content {
build()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment