Post

Replies

Boosts

Views

Activity

Reply to 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() } } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’23
Reply to Xcode 16.3 repeatedly log causing CPU leak
I have the same problem and my documentation indexing always gets stuck at about 15%. I've deleted the entire ~/Library/Developer folder with no change. • macOS 15.4 (24E248) • Xcode 16.3 (16E140) • M4 Pro (14-core) Mac mini
Replies
Boosts
Views
Activity
Apr ’25
Reply to 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() } } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to How to detect when a UITableViewCell becomes hidden or removed from memory when it has an edit control with focus
I was able to KVO UITableViewCell.layer.hidden as an indication that the cell has been removed from the table view
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jul ’21