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.
コード
1 2 3 4 5 6 7 8 9 10 11 12 13 |
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.
Sponsor Link