diff --git a/Notchy/View Controllers/WelcomeViewController.swift b/Notchy/View Controllers/WelcomeViewController.swift index 9e850e8..9e5021e 100644 --- a/Notchy/View Controllers/WelcomeViewController.swift +++ b/Notchy/View Controllers/WelcomeViewController.swift @@ -46,15 +46,17 @@ final class WelcomeViewController: UIViewController { @objc func selectScreenshotButtonDidTouchUpInside(_ sender: Any) { PHPhotoLibrary.requestAuthorization { [unowned self] status in - switch status { - case .notDetermined, .restricted, .denied: - let alert = UIAlertController(title: "Photo Library Inaccessible", message: "Notchy couldn't read your photo library.", preferredStyle: .alert) - alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) - self.present(alert, animated: true, completion: nil) - - case .authorized: - let navigation = NotchyNavigationController(rootViewController: GridViewController()) - self.present(navigation, animated: true, completion: nil) + DispatchQueue.main.async { + switch status { + case .notDetermined, .restricted, .denied: + let alert = UIAlertController(title: "Photo Library Inaccessible", message: "Notchy couldn't read your photo library.", preferredStyle: .alert) + alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) + self.present(alert, animated: true, completion: nil) + + case .authorized: + let navigation = NotchyNavigationController(rootViewController: GridViewController()) + self.present(navigation, animated: true, completion: nil) + } } } } diff --git a/Notchy/Views/NotchyToolbar.swift b/Notchy/Views/NotchyToolbar.swift index e058e72..cba16b3 100644 --- a/Notchy/Views/NotchyToolbar.swift +++ b/Notchy/Views/NotchyToolbar.swift @@ -96,7 +96,7 @@ final class CheckmarkView: UIStackView { } final class NotchyToolbar: UIView { - @objc private var delegate: NotchyToolbarDelegate! + @objc private weak var delegate: NotchyToolbarDelegate? private var shareButton: PlainButton! private var saveButton: ShortPlainButton!