forked from shadowfacts/Tusker
Fix reference cycles in gallery
This commit is contained in:
parent
3f90a0df04
commit
afcec24f86
|
@ -8,7 +8,7 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
public protocol GalleryContentViewControllerContainer {
|
public protocol GalleryContentViewControllerContainer: AnyObject {
|
||||||
var galleryControlsVisible: Bool { get }
|
var galleryControlsVisible: Bool { get }
|
||||||
|
|
||||||
func setGalleryContentLoading(_ loading: Bool)
|
func setGalleryContentLoading(_ loading: Bool)
|
||||||
|
|
|
@ -10,7 +10,7 @@ import UIKit
|
||||||
@MainActor
|
@MainActor
|
||||||
class GalleryDismissInteraction: NSObject {
|
class GalleryDismissInteraction: NSObject {
|
||||||
|
|
||||||
private let viewController: GalleryViewController
|
private unowned let viewController: GalleryViewController
|
||||||
|
|
||||||
private var content: GalleryContentViewController?
|
private var content: GalleryContentViewController?
|
||||||
private var origContentFrameInGallery: CGRect?
|
private var origContentFrameInGallery: CGRect?
|
||||||
|
|
|
@ -70,7 +70,7 @@ class FallbackGalleryNavigationController: UINavigationController, GalleryConten
|
||||||
|
|
||||||
// MARK: GalleryContentViewController
|
// MARK: GalleryContentViewController
|
||||||
|
|
||||||
var container: (any GalleryVC.GalleryContentViewControllerContainer)?
|
weak var container: (any GalleryVC.GalleryContentViewControllerContainer)?
|
||||||
|
|
||||||
var contentSize: CGSize {
|
var contentSize: CGSize {
|
||||||
.zero
|
.zero
|
||||||
|
|
|
@ -59,7 +59,7 @@ class GifvGalleryContentViewController: UIViewController, GalleryContentViewCont
|
||||||
|
|
||||||
// MARK: GalleryContentViewController
|
// MARK: GalleryContentViewController
|
||||||
|
|
||||||
var container: (any GalleryVC.GalleryContentViewControllerContainer)?
|
weak var container: (any GalleryVC.GalleryContentViewControllerContainer)?
|
||||||
|
|
||||||
var contentSize: CGSize {
|
var contentSize: CGSize {
|
||||||
controller.item.presentationSize
|
controller.item.presentationSize
|
||||||
|
|
|
@ -114,7 +114,7 @@ class ImageGalleryContentViewController: UIViewController, GalleryContentViewCon
|
||||||
|
|
||||||
// MARK: GalleryContentViewController
|
// MARK: GalleryContentViewController
|
||||||
|
|
||||||
var container: (any GalleryVC.GalleryContentViewControllerContainer)?
|
weak var container: (any GalleryVC.GalleryContentViewControllerContainer)?
|
||||||
|
|
||||||
var contentSize: CGSize {
|
var contentSize: CGSize {
|
||||||
image.size
|
image.size
|
||||||
|
|
|
@ -13,7 +13,7 @@ class LoadingGalleryContentViewController: UIViewController, GalleryContentViewC
|
||||||
private let provider: () async -> (any GalleryContentViewController)?
|
private let provider: () async -> (any GalleryContentViewController)?
|
||||||
private var wrapped: (any GalleryContentViewController)!
|
private var wrapped: (any GalleryContentViewController)!
|
||||||
|
|
||||||
var container: GalleryContentViewControllerContainer?
|
weak var container: GalleryContentViewControllerContainer?
|
||||||
|
|
||||||
var contentSize: CGSize {
|
var contentSize: CGSize {
|
||||||
wrapped?.contentSize ?? .zero
|
wrapped?.contentSize ?? .zero
|
||||||
|
|
|
@ -132,7 +132,7 @@ class VideoGalleryContentViewController: UIViewController, GalleryContentViewCon
|
||||||
|
|
||||||
// MARK: GalleryContentViewController
|
// MARK: GalleryContentViewController
|
||||||
|
|
||||||
var container: (any GalleryVC.GalleryContentViewControllerContainer)?
|
weak var container: (any GalleryVC.GalleryContentViewControllerContainer)?
|
||||||
|
|
||||||
var contentSize: CGSize {
|
var contentSize: CGSize {
|
||||||
item.presentationSize
|
item.presentationSize
|
||||||
|
|
Loading…
Reference in New Issue