Post

Replies

Boosts

Views

Activity

Is there a way to pass a ForEach variable out of the loop?
Here's my code.         HStack {             List {                 ForEach(friends, id:\.self) { row in                     Button(action: { isDetail.toggle() }, label: {                         Image(row.photo)                             .resizable()                             .aspectRatio(contentMode: ContentMode.fit)                             .frame(width: 80, height: 80)                             .clipped()                             .clipShape(Circle())                     })                 }             }         }         .frame(height: 400)         if isDetail {             AccessibleMindsHalfModalView(isShown: $isDetail, modalHeight: 400, content: {                 Text("Hello")             })         }
1
0
345
Mar ’21