diff --git a/Packages/GalleryVC/Sources/GalleryVC/GalleryContentViewControllerContainer.swift b/Packages/GalleryVC/Sources/GalleryVC/GalleryContentViewControllerContainer.swift index a812f3d5..ac7ef03f 100644 --- a/Packages/GalleryVC/Sources/GalleryVC/GalleryContentViewControllerContainer.swift +++ b/Packages/GalleryVC/Sources/GalleryVC/GalleryContentViewControllerContainer.swift @@ -8,7 +8,7 @@ import Foundation @MainActor -public protocol GalleryContentViewControllerContainer { +public protocol GalleryContentViewControllerContainer: AnyObject { var galleryControlsVisible: Bool { get } func setGalleryContentLoading(_ loading: Bool) diff --git a/Packages/GalleryVC/Sources/GalleryVC/GalleryDismissInteraction.swift b/Packages/GalleryVC/Sources/GalleryVC/GalleryDismissInteraction.swift index 8711f6ee..f49b9621 100644 --- a/Packages/GalleryVC/Sources/GalleryVC/GalleryDismissInteraction.swift +++ b/Packages/GalleryVC/Sources/GalleryVC/GalleryDismissInteraction.swift @@ -10,7 +10,7 @@ import UIKit @MainActor class GalleryDismissInteraction: NSObject { - private let viewController: GalleryViewController + private unowned let viewController: GalleryViewController private var content: GalleryContentViewController? private var origContentFrameInGallery: CGRect? diff --git a/Tusker/Screens/Gallery/FallbackGalleryContentViewController.swift b/Tusker/Screens/Gallery/FallbackGalleryContentViewController.swift index 0ac74023..b3b959e2 100644 --- a/Tusker/Screens/Gallery/FallbackGalleryContentViewController.swift +++ b/Tusker/Screens/Gallery/FallbackGalleryContentViewController.swift @@ -70,7 +70,7 @@ class FallbackGalleryNavigationController: UINavigationController, GalleryConten // MARK: GalleryContentViewController - var container: (any GalleryVC.GalleryContentViewControllerContainer)? + weak var container: (any GalleryVC.GalleryContentViewControllerContainer)? var contentSize: CGSize { .zero diff --git a/Tusker/Screens/Gallery/GifvGalleryContentViewController.swift b/Tusker/Screens/Gallery/GifvGalleryContentViewController.swift index 178ee1ec..a5d73a1b 100644 --- a/Tusker/Screens/Gallery/GifvGalleryContentViewController.swift +++ b/Tusker/Screens/Gallery/GifvGalleryContentViewController.swift @@ -59,7 +59,7 @@ class GifvGalleryContentViewController: UIViewController, GalleryContentViewCont // MARK: GalleryContentViewController - var container: (any GalleryVC.GalleryContentViewControllerContainer)? + weak var container: (any GalleryVC.GalleryContentViewControllerContainer)? var contentSize: CGSize { controller.item.presentationSize diff --git a/Tusker/Screens/Gallery/ImageGalleryContentViewController.swift b/Tusker/Screens/Gallery/ImageGalleryContentViewController.swift index e723d102..b728f4c3 100644 --- a/Tusker/Screens/Gallery/ImageGalleryContentViewController.swift +++ b/Tusker/Screens/Gallery/ImageGalleryContentViewController.swift @@ -114,7 +114,7 @@ class ImageGalleryContentViewController: UIViewController, GalleryContentViewCon // MARK: GalleryContentViewController - var container: (any GalleryVC.GalleryContentViewControllerContainer)? + weak var container: (any GalleryVC.GalleryContentViewControllerContainer)? var contentSize: CGSize { image.size diff --git a/Tusker/Screens/Gallery/LoadingGalleryContentViewController.swift b/Tusker/Screens/Gallery/LoadingGalleryContentViewController.swift index a78b0e80..e8ef4e9d 100644 --- a/Tusker/Screens/Gallery/LoadingGalleryContentViewController.swift +++ b/Tusker/Screens/Gallery/LoadingGalleryContentViewController.swift @@ -13,7 +13,7 @@ class LoadingGalleryContentViewController: UIViewController, GalleryContentViewC private let provider: () async -> (any GalleryContentViewController)? private var wrapped: (any GalleryContentViewController)! - var container: GalleryContentViewControllerContainer? + weak var container: GalleryContentViewControllerContainer? var contentSize: CGSize { wrapped?.contentSize ?? .zero diff --git a/Tusker/Screens/Gallery/VideoGalleryContentViewController.swift b/Tusker/Screens/Gallery/VideoGalleryContentViewController.swift index 1f44e4f6..e022fc1a 100644 --- a/Tusker/Screens/Gallery/VideoGalleryContentViewController.swift +++ b/Tusker/Screens/Gallery/VideoGalleryContentViewController.swift @@ -132,7 +132,7 @@ class VideoGalleryContentViewController: UIViewController, GalleryContentViewCon // MARK: GalleryContentViewController - var container: (any GalleryVC.GalleryContentViewControllerContainer)? + weak var container: (any GalleryVC.GalleryContentViewControllerContainer)? var contentSize: CGSize { item.presentationSize