Add @ViewBuilder annotation

This commit is contained in:
1024jp 2024-05-10 14:29:10 +09:00
parent b2e98ab866
commit e5ab085f0d
4 changed files with 5 additions and 5 deletions

View File

@ -255,7 +255,7 @@ private struct CreditsView: View {
var content: () -> Content
init(_ label: String, content: @escaping () -> Content) {
init(_ label: String, @ViewBuilder content: @escaping () -> Content) {
self.label = label
self.content = content

View File

@ -51,11 +51,11 @@ private extension Edge {
}
private struct PopoverHolderView<T: View>: NSViewRepresentable {
private struct PopoverHolderView<Content: View>: NSViewRepresentable {
@Binding var isPresented: Bool
let arrowEdge: Edge
var content: () -> T
@ViewBuilder var content: () -> Content
func makeNSView(context: Context) -> NSView {

View File

@ -78,7 +78,7 @@ struct SyntaxFileMappingEditView: View {
@Binding var items: [Item]
let label: () -> (Label)
let label: () -> Label
@State private var selection: Set<Item.ID> = []
@FocusState private var focusedField: Item.ID?

View File

@ -29,7 +29,7 @@ struct WrappingHStack<Content: View>: View {
var horizontalSpacing: Double = 4
var verticalSpacing: Double = 4
var content: () -> Content
@ViewBuilder var content: () -> Content
var body: some View {