From c42177daef6240ee3952a07a34a518f9b4bd0658 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 20 Jun 2023 14:41:44 +1000 Subject: [PATCH 1/3] Call appropriate `super` method from `viewWillDisappear` --- Sources/MediaEditor.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/MediaEditor.swift b/Sources/MediaEditor.swift index 07f02a1..972ad3b 100644 --- a/Sources/MediaEditor.swift +++ b/Sources/MediaEditor.swift @@ -141,7 +141,7 @@ open class MediaEditor: UINavigationController { } public override func viewWillDisappear(_ animated: Bool) { - super.viewWillAppear(animated) + super.viewWillDisappear(animated) currentCapability = nil } From a0dfd6f9fddb70008bb0f091bea3e94d83dc83a9 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 20 Jun 2023 14:45:15 +1000 Subject: [PATCH 2/3] Add a missing call to `super.viewDidLoad` There are reasons to believe the method in `UIViewController` to be doing nothing: https://stackoverflow.com/a/51995637/809944 However, given we don't know for sure and that the behavior might change at any time, it seems wise to call it. --- Sources/Capabilities/Filters/MediaEditorFilters.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/Capabilities/Filters/MediaEditorFilters.swift b/Sources/Capabilities/Filters/MediaEditorFilters.swift index edcc132..a0af514 100644 --- a/Sources/Capabilities/Filters/MediaEditorFilters.swift +++ b/Sources/Capabilities/Filters/MediaEditorFilters.swift @@ -72,6 +72,7 @@ class MediaEditorFilters: UIViewController { private var selectedFilterIndex = IndexPath(row: 0, section: 0) override func viewDidLoad() { + super.viewDidLoad() imageView.image = image filtersCollectionView.dataSource = self filtersCollectionView.delegate = self From 4ccf42586929bfcb4531af957f243f3a323f478b Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 20 Jun 2023 15:16:40 +1000 Subject: [PATCH 3/3] Add changelog entry for #40 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6a7b4f..f54a19e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ _None._ ### Bug Fixes -_None._ +- Fix a `viewWillDisappear` method calling `super.viewWillAppear` [#40] ### Internal Changes