forked from organicmaps/organicmaps
[ios] fix screen freezing when the PP relaods on viewWillAppear
Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
parent
35be2a37d7
commit
97a0544a55
2 changed files with 10 additions and 0 deletions
|
@ -114,7 +114,13 @@ class PlacePageInfoViewController: UIViewController {
|
|||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
delegate?.viewWillAppear()
|
||||
}
|
||||
|
||||
// MARK: private
|
||||
private func setupViews() {
|
||||
if let openingHours = placePageInfoData.openingHours {
|
||||
openingHoursView.openingHours = openingHours
|
||||
addToStack(openingHoursView)
|
||||
|
|
|
@ -8,6 +8,7 @@ class PlacePageInteractor: NSObject {
|
|||
weak var mapViewController: MapViewController?
|
||||
private let bookmarksManager = BookmarksManager.shared()
|
||||
private var placePageData: PlacePageData
|
||||
private var viewWillAppearIsCalledForTheFirstTime = false
|
||||
|
||||
init(viewController: UIViewController, data: PlacePageData, mapViewController: MapViewController) {
|
||||
self.placePageData = data
|
||||
|
@ -50,6 +51,9 @@ extension PlacePageInteractor: PlacePageInteractorProtocol {
|
|||
|
||||
extension PlacePageInteractor: PlacePageInfoViewControllerDelegate {
|
||||
func viewWillAppear() {
|
||||
// Skip data reloading on the first appearance, to avoid unnecessary updates.
|
||||
guard viewWillAppearIsCalledForTheFirstTime else { return }
|
||||
viewWillAppearIsCalledForTheFirstTime = true
|
||||
updateBookmarkIfNeeded()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue