metatext/Shared/Views/LazyView.swift

18 lines
312 B
Swift
Raw Normal View History

2020-08-19 22:16:03 +00:00
// 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()
}
}