Post

Replies

Boosts

Views

Activity

Reply to NavigationLink stays highlighted after returning from Detail View
Yes, I have the same problem in some lists in my app. Rows stay highlighted after navigating back. I have created a really easy solution to remove the highlight color in these situations. I use NotificationCenter to notify when the NavigationLink is tapped and use some UIKit-magic to deselect the cells. Works like a charm. All you need to do is add this block of code. Note that if your list has multiple sections, you have to modify the code. .onReceive(NotificationCenter.default.publisher(for: UITableView.selectionDidChangeNotification)) { notification in             if let tableView = notification.object as? UITableView {                 let numberOfRows = tableView.numberOfRows(inSection: 0)                 guard numberOfRows 0 else { return }                 for i in 0...rows - 1 {                     tableView.deselectRow(at: IndexPath(row: i, section: 0), animated: true)                 }             }         }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to Navigation in IPad SplitView in iOS 14.5 beta is completely broken
New 14.5 Beta 5 was just released. Issue still remains. Still no response from Apple to my feedback. I just send an email to app support, let's see if I can get a response in that way. In thew meanwhile, please test my issue and send also feedback to Apple. They have introduced an undocumented change to navigationsystem in SwiftUI and it's really bad for exsisting apps.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21