SwiftUI 踩坑记——ForEach 创建 view报错:Fatal error: each layout item may only occur once: file SwiftUI, l...
SwiftUI使用ForEach创建view时报错:Fatalerror:eachlayoutitemmayonlyoccuronce:fileSwiftUI,line0代码片段如下:letarray=["1","1","2","3","4","5","6"]ForEach(array,id:\.self){iteminText(item)}如果数组里面有重复的数据(例如上面的多个“1”),就会报