ForEach value is only the first item in the Array

Don’t make an extension of Character conforming to Identifiable. Instead, do the following:

ForEach(Array("val"), id: \.self)

I don’t know your implementation of the extension, and so just using \.self with Character works. However, you can conform Character to Identifiable, such as:

extension Character: Identifiable {
    
    public var id: Character { self }
}

which is equivalent to \.self. From the issue experienced I can assume there is a problem with the implementation, such as giving the same id, for example:

extension Character: Identifiable {
    
    public var id: Int { 1 }
}

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top