Digital PCT265 defect CXTDT-579050: Prevent updateViews from triggering tableView(_:cellForRowAt:) through visibleCells.
This commit is contained in:
parent
3cdd74f097
commit
91eb4fa87a
@ -52,8 +52,8 @@ open class ThreeLayerTableViewController: ProgrammaticTableViewController, Rotor
|
||||
bottomView.updateView(width)
|
||||
showFooter(width)
|
||||
}
|
||||
tableView.visibleCells.forEach { cell in
|
||||
(cell as? MVMCoreViewProtocol)?.updateView(width)
|
||||
MVMCoreUIUtility.findParentViews(by: (UITableViewCell & MVMCoreViewProtocol).self, views: tableView.subviews).forEach { view in
|
||||
view.updateView(width)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -60,6 +60,16 @@ public extension MVMCoreUIUtility {
|
||||
return findViews(by: type, views: queue, excludedViews: excludedViews) + matching
|
||||
}
|
||||
|
||||
static func findParentViews<T>(by type: T.Type, views: [UIView]) -> [T] {
|
||||
return views.reduce(into: [T]()) { matchingViews, view in
|
||||
if let view = view as? T {
|
||||
return matchingViews.append(view) // If this view is the type stop here and return, ignoring its children.
|
||||
}
|
||||
// Otherwise check downstream.
|
||||
matchingViews += findParentViews(by: type, views: view.subviews)
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor
|
||||
static func visibleNavigationBarStlye() -> NavigationItemStyle? {
|
||||
if let navController = NavigationController.navigationController(),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user