Day 94 of #100DaysOfSwiftUI

Start 100DaysOfSwiftUI from 2020.Mar.18th.

Day 94: Project 18, part three (conti.) challenge 2
done with 1 hours

Maybe something wrong, but following code also works.

コード

List(usedWords, id:\.self) { word in
    HStack {
        Image(systemName: "\(word.count).circle")
        Text(word)
    }
    .accessibilityElement(children: .ignore)
    .accessibility(label: Text("\(word), \(word.count) letters"))
.offset(x:
    (self.usedWords.firstIndex(of: word)! < 2 ? 0 : (10 * CGFloat(((self.usedWords.firstIndex(of: word))!))))
    )
}

I used .offset modifier instead of using GeometryReader.

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です