IOS15
1、Index out of range (TabView)
- TabView显示page样式时没数据IOS15及以下会崩溃
TabView {
}
.tabViewStyle(.page(indexDisplayMode: .always)) // 漰
// .tabViewStyle(.page(indexDisplayMode: .never)) // 不漰
IOS14
1、each layout item may only occur once(ForEach)
ForEach 的对象id相同时
class CCModel: NSObject, Identifiable {
let id = UUID()
}
@State var list: [[CCModel]] = [[CCModel](repeating: DiyPageModel(), count: 3)]
// ForEach(list.indices, id: \.self) { inddex in 这种可以解决
ForEach(list) { iitem in // 漰了
}