Using ForEach with a string array - [String] has no member 'identified'

前端 未结 4 1046
走了就别回头了
走了就别回头了 2021-01-22 08:58

I\'m using Xcode 11 beta 5 and what I had it doesn\'t work anymore. This is my code:

struct ModeView : View {
  @EnvironmentObject var state: IntentionState

  v         


        
4条回答
  •  一生所求
    2021-01-22 09:45

    ForEach syntax changed a little bit in Beta 5.

    Have you tried:

    ForEach(state.modes, id: \.self) { mode in
        Text(mode)
    }
    

提交回复
热议问题