From af116559cd3e19af371d7f88ad939a8fbc0b4fb2 Mon Sep 17 00:00:00 2001
From: Marko Tadic <tadija@me.com>
Date: Fri, 12 Aug 2022 15:04:57 +0200
Subject: [PATCH] Fix build warnings with Xcode 13.4.1

---
 Sources/Debug Plugin/HeroDebugView.swift       | 2 +-
 Sources/Extensions/UIViewController+Hero.swift | 2 +-
 Sources/HeroTypes.swift                        | 6 +++---
 Sources/Transition/HeroProgressRunner.swift    | 2 +-
 Sources/Transition/HeroTransition.swift        | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Sources/Debug Plugin/HeroDebugView.swift b/Sources/Debug Plugin/HeroDebugView.swift
index fc3de27d..414edce0 100644
--- a/Sources/Debug Plugin/HeroDebugView.swift	
+++ b/Sources/Debug Plugin/HeroDebugView.swift	
@@ -24,7 +24,7 @@
 
 import UIKit
 
-protocol HeroDebugViewDelegate: class {
+protocol HeroDebugViewDelegate: AnyObject {
   func onProcessSliderChanged(progress: Float)
   func onPerspectiveChanged(translation: CGPoint, rotation: CGFloat, scale: CGFloat)
   func on3D(wants3D: Bool)
diff --git a/Sources/Extensions/UIViewController+Hero.swift b/Sources/Extensions/UIViewController+Hero.swift
index 16af8ae4..da725585 100644
--- a/Sources/Extensions/UIViewController+Hero.swift
+++ b/Sources/Extensions/UIViewController+Hero.swift
@@ -334,7 +334,7 @@ public extension HeroExtension where Base: UIViewController {
       }
     } else if let baseWindow = base.view.window, baseWindow.rootViewController == base {
       hero.transition(from: base, to: next, in: baseWindow) { [weak base] finished in
-        guard let base = base, finished else { return }
+        guard base != nil, finished else { return }
         baseWindow.rootViewController = next
       }
     }
diff --git a/Sources/HeroTypes.swift b/Sources/HeroTypes.swift
index 7949cc62..9b69c578 100644
--- a/Sources/HeroTypes.swift
+++ b/Sources/HeroTypes.swift
@@ -24,12 +24,12 @@
 
 import UIKit
 
-public protocol HeroPreprocessor: class {
+public protocol HeroPreprocessor: AnyObject {
   var hero: HeroTransition! { get set }
   func process(fromViews: [UIView], toViews: [UIView])
 }
 
-public protocol HeroAnimator: class {
+public protocol HeroAnimator: AnyObject {
   var hero: HeroTransition! { get set }
   func canAnimate(view: UIView, appearing: Bool) -> Bool
   func animate(fromViews: [UIView], toViews: [UIView]) -> TimeInterval
@@ -41,7 +41,7 @@ public protocol HeroAnimator: class {
   func changeTarget(state: HeroTargetState, isDestination: Bool, to view: UIView)
 }
 
-public protocol HeroProgressUpdateObserver: class {
+public protocol HeroProgressUpdateObserver: AnyObject {
   func heroDidUpdateProgress(progress: Double)
 }
 
diff --git a/Sources/Transition/HeroProgressRunner.swift b/Sources/Transition/HeroProgressRunner.swift
index df8cc582..46518a45 100644
--- a/Sources/Transition/HeroProgressRunner.swift
+++ b/Sources/Transition/HeroProgressRunner.swift
@@ -23,7 +23,7 @@
 #if canImport(UIKit)
 import QuartzCore
 
-protocol HeroProgressRunnerDelegate: class {
+protocol HeroProgressRunnerDelegate: AnyObject {
   func updateProgress(progress: Double)
   func complete(finished: Bool)
 }
diff --git a/Sources/Transition/HeroTransition.swift b/Sources/Transition/HeroTransition.swift
index 3ff7d836..87da613f 100644
--- a/Sources/Transition/HeroTransition.swift
+++ b/Sources/Transition/HeroTransition.swift
@@ -45,7 +45,7 @@ public class Hero: NSObject {
   public static var shared = HeroTransition()
 }
 
-public protocol HeroTransitionDelegate: class {
+public protocol HeroTransitionDelegate: AnyObject {
   func heroTransition(_ hero: HeroTransition, didUpdate state: HeroTransitionState)
   func heroTransition(_ hero: HeroTransition, didUpdate progress: Double)
 }