Skip to content

Commit 2d5de74

Browse files
mkieselmannSD10
authored andcommitted
Dont store strong references to Navigation and TabBarController delegates (#516)
Holding strong references leads to reference cycles if the delegate is set to self.
1 parent 0c5ebbd commit 2d5de74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/Extensions/UIViewController+Hero.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ internal class HeroViewControllerConfig: NSObject {
2828
var tabBarAnimation: HeroDefaultAnimationType = .auto
2929

3030
var storedSnapshot: UIView?
31-
var previousNavigationDelegate: UINavigationControllerDelegate?
32-
var previousTabBarDelegate: UITabBarControllerDelegate?
31+
weak var previousNavigationDelegate: UINavigationControllerDelegate?
32+
weak var previousTabBarDelegate: UITabBarControllerDelegate?
3333
}
3434

3535
extension UIViewController: HeroCompatible { }

0 commit comments

Comments
 (0)