From 5a43886640c330d51645c89846138a76af889c5d Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 12 Jan 2025 21:55:09 -0800 Subject: [PATCH] Move ImageViewController out of storyboard and into its own xib. --- iOS/Article/ImageViewController.swift | 11 ++- iOS/Article/ImageViewController.xib | 107 ++++++++++++++++++++++++++ iOS/Base.lproj/Main.storyboard | 96 +---------------------- iOS/SceneCoordinator.swift | 2 +- 4 files changed, 118 insertions(+), 98 deletions(-) create mode 100644 iOS/Article/ImageViewController.xib diff --git a/iOS/Article/ImageViewController.swift b/iOS/Article/ImageViewController.swift index 91d8a17d9..16f27a1ae 100644 --- a/iOS/Article/ImageViewController.swift +++ b/iOS/Article/ImageViewController.swift @@ -8,9 +8,8 @@ import UIKit -class ImageViewController: UIViewController { +final class ImageViewController: UIViewController { - @IBOutlet weak var closeButton: UIButton! @IBOutlet weak var shareButton: UIButton! @IBOutlet weak var imageScrollView: ImageScrollView! @@ -24,6 +23,14 @@ class ImageViewController: UIViewController { var zoomedFrame: CGRect { return imageScrollView.zoomedFrame } + + init() { + super.init(nibName: "ImageViewController", bundle: nil) + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + } override func viewDidLoad() { super.viewDidLoad() diff --git a/iOS/Article/ImageViewController.xib b/iOS/Article/ImageViewController.xib new file mode 100644 index 000000000..07569078f --- /dev/null +++ b/iOS/Article/ImageViewController.xib @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iOS/Base.lproj/Main.storyboard b/iOS/Base.lproj/Main.storyboard index 8e7b0af8f..a8fcd9650 100644 --- a/iOS/Base.lproj/Main.storyboard +++ b/iOS/Base.lproj/Main.storyboard @@ -114,7 +114,7 @@ - + @@ -232,95 +232,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -417,16 +328,11 @@ - - - - - diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index a0b4e3b65..e89dc71e1 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -1180,7 +1180,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner { } func showFullScreenImage(image: UIImage, imageTitle: String?, transitioningDelegate: UIViewControllerTransitioningDelegate) { - let imageVC = UIStoryboard.main.instantiateController(ofType: ImageViewController.self) + let imageVC = ImageViewController() imageVC.image = image imageVC.imageTitle = imageTitle imageVC.modalPresentationStyle = .currentContext