Skip to content

Use of unresolved identifier 'IfLet' #3

Description

@changtraisitinh

I have an issue when applying to the none SwiftUI project using subclass the UIHostingController.

file SettingsNodesView.swift

fileprivate func nodeCellFor(_ node: Node) -> some View {
    return NavigationLink(destination: SettingsNodesView(nodes: node.children)) {
        HStack {
            IfLet (node.image) { image in
                Image(uiImage: image).renderingMode(.template)
            }
            Text(node.name)
            Spacer()
            Text(node.children.count == 0 ? "Leaf node" : "\(node.children.count) child nodes").foregroundColor(Color.secondary)
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions