How to solve this error please.
(请如何解决此错误。)
The compiler is unable to type-check this expression in reasonable time;
(编译器无法在合理的时间内对这个表达式进行类型检查。)
try breaking up the expression into distinct sub-expressions (尝试将表达式分解为不同的子表达式)
while trying to disable the posts assigned to each groupsShortcut.
(同时尝试禁用分配给每个组快捷方式的帖子。)
this is my code:
(这是我的代码:)
import SwiftUI
import Firebase
struct PostView: View {
@EnvironmentObject var observedData : getData
var body : some View{
NavigationView{// Here is the error position.
ScrollView(.vertical, showsIndicators: false) {
VStack(alignment: .leading){
ForEach(observedData.datas){i in
if i.groupsShortcut == "RN"{
tweetCellTop(name: i.name, id: i.tagId, pic: i.pic, image: i.url, msg: i.msg)
if i.pic != ""{
tweetCellMiddle(pic: i.pic).padding(.leading, 60)
}
tweetCellBottom().offset(x: UIScreen.main.bounds.width / 4)
}
}
}
}.padding(.bottom, 15)
.navigationBarTitle("Posts")
.navigationBarItems(leading:
Image(" user Image ").resizable().frame(width: 35, height: 35).clipShape(Circle()).onTapGesture {
print("slide out menu ....")
}
)
}
}
}
struct PostView_Previews: PreviewProvider {
@EnvironmentObject var observedData : getData
static var previews: some View {
PostView().environmentObject(getData())
}
}
ask by Alex translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…