Sunday, March 31, 2024
HomeiOS DevelopmentNo precise matches in reference to static technique 'buildExpression'

No precise matches in reference to static technique ‘buildExpression’


I am attempting to create a Settings module utilizing SwiftUI.

I’ve the next hierarchy

  • Settings (struct)
    • Part (struct)
      • Subsection (struct)
        • ButtonRow: Row
      • Subsection (struct)
        • ButtonRow: Row
        • ToggleRow: Row
    • Part (struct)
      • Subsection (struct)
        • ButtonRow: Row

The Row protocol is carried out as follows:

public protocol Row: Identifiable {
    var id: UUID { get }
    
    associatedtype Physique = View
    var physique: Physique { get }
}

Every Row implementation must implement its personal View that might be rendered in Settings

struct ButtonRow: Row {
    public var id: UUID = UUID()
    public var title: String
    
    init(_ title: String) {
        self.title = title
    }
    
    public var physique: some View {
        Textual content("Teste")
    }   
}

Nonetheless, I’m having the next error within the part highlighted within the code beneath:
enter picture description right here

Does anybody know the way I can resolve this?

I attempted utilizing AnyView(row.physique) however I feel it’s not the most effective answer when it comes to app efficiency and after I add a Toggle it’s not animated.



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments