Post marked as solved
Click to stop watching this thread.
You have stopped watching this post. Click to start watching again.
contentPostList.repliessolved.tooltip
Replied In
Dynamic Type and Widget Layout
To answer my own question:
Use ViewThatFits and build views with every possible count. Seems unnecessarily expensive but it works.
var body: some View {
ViewThatFits {
ForEach((1...entry.toDos.count).reversed(), id: \.self) { limit in
VStack(alignment: .leading, spacing: 4) {
ForEach(entry.toDos.prefix(limit), id: \.self.identifier) { entry in
ToDoView(checked: entry.completed, flag: entry.flag, text: entry.name)
}
if (limit < entry.toDos.count) {
Text(String(format:NSLocalizedString("%i more...", comment: "[n] more..."), entry.toDos.count - limit))
.font(.footnote)
.foregroundStyle(.secondary)
.padding(.leading, 24)
.padding(.top, -3)
.unredacted()
}
}
}
}
}