Fix reference cycles in gallery

This commit is contained in:
Shadowfacts 2024-03-31 23:27:56 -04:00
parent 3f90a0df04
commit afcec24f86
7 changed files with 7 additions and 7 deletions

View File

@ -8,7 +8,7 @@
import Foundation
@MainActor
public protocol GalleryContentViewControllerContainer {
public protocol GalleryContentViewControllerContainer: AnyObject {
var galleryControlsVisible: Bool { get }
func setGalleryContentLoading(_ loading: Bool)

View File

@ -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?

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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