mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-22 16:21:00 +00:00
17 lines
312 B
Swift
17 lines
312 B
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
import SwiftUI
|
|
|
|
struct LazyView<V: View>: View {
|
|
typealias RenderClosure = () -> V
|
|
|
|
let render: RenderClosure
|
|
|
|
init(_ render: @autoclosure @escaping RenderClosure) {
|
|
self.render = render
|
|
}
|
|
|
|
var body: V {
|
|
render()
|
|
}
|
|
}
|