Skip to content

Commit

Permalink
Reload rows on viewWillAppear for iOS 12 and below. (#2029)
Browse files Browse the repository at this point in the history
  • Loading branch information
mats-claassen authored Apr 28, 2020
1 parent 9a30ae4 commit 62484db
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Source/Core/Core.swift
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,14 @@ open class FormViewController: UIViewController, FormViewControllerProtocol, For
super.viewWillAppear(animated)
animateTableView = true
let selectedIndexPaths = tableView.indexPathsForSelectedRows ?? []
if !selectedIndexPaths.isEmpty, tableView.window != nil {
tableView.reloadRows(at: selectedIndexPaths, with: .none)
if !selectedIndexPaths.isEmpty {
if #available(iOS 13.0, *) {
if tableView.window != nil {
tableView.reloadRows(at: selectedIndexPaths, with: .none)
}
} else {
tableView.reloadRows(at: selectedIndexPaths, with: .none)
}
}
selectedIndexPaths.forEach {
tableView.selectRow(at: $0, animated: false, scrollPosition: .none)
Expand Down

0 comments on commit 62484db

Please sign in to comment.