From 03eff6a0da612ebb46e4ca0831c9f044f2ea7e13 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 6 May 2024 22:18:09 -0700 Subject: [PATCH] =?UTF-8?q?Move=20UIPageViewController=20extension=20to=20?= =?UTF-8?q?the=20file=20where=20it=E2=80=99s=20used.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NetNewsWire.xcodeproj/project.pbxproj | 4 ---- iOS/Article/ArticleViewController.swift | 15 ++++++++++++- .../UIPageViewController-Extensions.swift | 22 ------------------- 3 files changed, 14 insertions(+), 27 deletions(-) delete mode 100644 iOS/UIKit Extensions/UIPageViewController-Extensions.swift diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index d367b2909..981c894dc 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -182,7 +182,6 @@ 51707439232AA97100A461A3 /* ShareFolderPickerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51707438232AA97100A461A3 /* ShareFolderPickerController.swift */; }; 517630042336215100E15FFF /* main.js in Resources */ = {isa = PBXBuildFile; fileRef = 517630032336215100E15FFF /* main.js */; }; 517630052336215100E15FFF /* main.js in Resources */ = {isa = PBXBuildFile; fileRef = 517630032336215100E15FFF /* main.js */; }; - 517A745B2443665000B553B9 /* UIPageViewController-Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 517A745A2443665000B553B9 /* UIPageViewController-Extensions.swift */; }; 5183CCD0226E1E880010922C /* NonIntrinsicLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5183CCCF226E1E880010922C /* NonIntrinsicLabel.swift */; }; 5183CCDA226E31A50010922C /* NonIntrinsicImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5183CCD9226E31A50010922C /* NonIntrinsicImageView.swift */; }; 5183CCE5226F4DFA0010922C /* RefreshInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5183CCE4226F4DFA0010922C /* RefreshInterval.swift */; }; @@ -1113,7 +1112,6 @@ 516AE9B22371C372007DEEAA /* FeedTableViewSectionHeaderLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedTableViewSectionHeaderLayout.swift; sourceTree = ""; }; 51707438232AA97100A461A3 /* ShareFolderPickerController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareFolderPickerController.swift; sourceTree = ""; }; 517630032336215100E15FFF /* main.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = main.js; sourceTree = ""; }; - 517A745A2443665000B553B9 /* UIPageViewController-Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIPageViewController-Extensions.swift"; sourceTree = ""; }; 5183CCCF226E1E880010922C /* NonIntrinsicLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NonIntrinsicLabel.swift; sourceTree = ""; }; 5183CCD9226E31A50010922C /* NonIntrinsicImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NonIntrinsicImageView.swift; sourceTree = ""; }; 5183CCE4226F4DFA0010922C /* RefreshInterval.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RefreshInterval.swift; sourceTree = ""; }; @@ -1858,7 +1856,6 @@ C5A6ED6C23C9B0C800AB6BE2 /* UIActivityViewController-Extensions.swift */, 51F85BF82274AA7B00C787DC /* UIBarButtonItem-Extensions.swift */, 51F85BF622749FA100C787DC /* UIFont-Extensions.swift */, - 517A745A2443665000B553B9 /* UIPageViewController-Extensions.swift */, 51C4524E226506F400C03939 /* UIStoryboard-Extensions.swift */, 518ED21C23D0F26000E0A862 /* UIViewController-Extensions.swift */, 51FFF0C3235EE8E5002762AA /* VibrantButton.swift */, @@ -3848,7 +3845,6 @@ 84CAFCB022BC8C35007694F0 /* FetchRequestOperation.swift in Sources */, 51938DF3231AFC660055A1A0 /* SearchTimelineFeedDelegate.swift in Sources */, 51C4525A226508D600C03939 /* UIStoryboard-Extensions.swift in Sources */, - 517A745B2443665000B553B9 /* UIPageViewController-Extensions.swift in Sources */, 51BB7C272335A8E5008E8144 /* ArticleActivityItemSource.swift in Sources */, 177A0C2D25454AAB00D7EAF6 /* ReaderAPIAccountViewController.swift in Sources */, 51C452A622650A3500C03939 /* Node-Extensions.swift in Sources */, diff --git a/iOS/Article/ArticleViewController.swift b/iOS/Article/ArticleViewController.swift index 6f60b462d..aea76212f 100644 --- a/iOS/Article/ArticleViewController.swift +++ b/iOS/Article/ArticleViewController.swift @@ -13,7 +13,7 @@ import Articles import SafariServices import ArticleExtractor -class ArticleViewController: UIViewController { +final class ArticleViewController: UIViewController { typealias State = (extractedArticle: ExtractedArticle?, isShowingExtractedArticle: Bool, @@ -509,3 +509,16 @@ private extension ArticleViewController { } } + +private extension UIPageViewController { + + var scrollViewInsidePageControl: UIScrollView? { + + for view in view.subviews { + if let scrollView = view as? UIScrollView { + return scrollView + } + } + return nil + } +} diff --git a/iOS/UIKit Extensions/UIPageViewController-Extensions.swift b/iOS/UIKit Extensions/UIPageViewController-Extensions.swift deleted file mode 100644 index 8db0ce553..000000000 --- a/iOS/UIKit Extensions/UIPageViewController-Extensions.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// UIPageViewController-Extensions.swift -// NetNewsWire-iOS -// -// Created by Maurice Parker on 4/12/20. -// Copyright © 2020 Ranchero Software. All rights reserved. -// - -import UIKit - -extension UIPageViewController { - - var scrollViewInsidePageControl: UIScrollView? { - for view in view.subviews { - if let scrollView = view as? UIScrollView { - return scrollView - } - } - return nil - } - -}