Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
LazyView
struct LazyView<Content: View>: View {
let build: () -> Content
init(_ build: @autoclosure @escaping () -> Content) {
self.build = build
}
var body: Content {
build()
}
}
@ahmetws

This comment has been minimized.

Copy link

ahmetws commented Nov 21, 2019

Thanks for the code, Chris 👍
Here is the relevant discussion: https://twitter.com/chriseidhof/status/1144242544680849410

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.