From 62484db23cbb1db5b90cd9e6df08dd5e976c4d8a Mon Sep 17 00:00:00 2001 From: Mathias Claassen Date: Tue, 28 Apr 2020 08:54:06 -0300 Subject: [PATCH] Reload rows on viewWillAppear for iOS 12 and below. (#2029) --- Source/Core/Core.swift | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core.swift b/Source/Core/Core.swift index b9f14087e..9424c63a0 100644 --- a/Source/Core/Core.swift +++ b/Source/Core/Core.swift @@ -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)