diff --git a/FoundationExtras/Sources/FoundationExtras/Array+RSCore.swift b/FoundationExtras/Sources/FoundationExtras/Array+Extensions.swift similarity index 76% rename from FoundationExtras/Sources/FoundationExtras/Array+RSCore.swift rename to FoundationExtras/Sources/FoundationExtras/Array+Extensions.swift index e583824f3..37365c4ab 100644 --- a/FoundationExtras/Sources/FoundationExtras/Array+RSCore.swift +++ b/FoundationExtras/Sources/FoundationExtras/Array+Extensions.swift @@ -15,7 +15,6 @@ public extension Array { Array(self[$0 ..< Swift.min($0 + size, count)]) } } - } public extension Array where Element: Equatable { @@ -24,5 +23,16 @@ public extension Array where Element: Equatable { guard let index = firstIndex(of: object) else {return} remove(at: index) } - +} + +public extension Array where Element == CGRect { + + func maxY() -> CGFloat { + + var y: CGFloat = 0.0 + for r in self { + y = Swift.max(y, r.maxY) + } + return y + } } diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index 9628b876c..af6be0616 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -333,7 +333,6 @@ 51F85BF52273625800C787DC /* Bundle-Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51F85BF42273625800C787DC /* Bundle-Extensions.swift */; }; 51F85BF722749FA100C787DC /* UIFont-Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51F85BF622749FA100C787DC /* UIFont-Extensions.swift */; }; 51F85BF92274AA7B00C787DC /* UIBarButtonItem-Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51F85BF82274AA7B00C787DC /* UIBarButtonItem-Extensions.swift */; }; - 51F85BFB2275D85000C787DC /* Array-Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51F85BFA2275D85000C787DC /* Array-Extensions.swift */; }; 51F85BFD2275DCA800C787DC /* SingleLineUILabelSizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51F85BFC2275DCA800C787DC /* SingleLineUILabelSizer.swift */; }; 51F9F3F723DF6DB200A314FD /* ArticleIconSchemeHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51F9F3F623DF6DB200A314FD /* ArticleIconSchemeHandler.swift */; }; 51F9F3F923DFB16300A314FD /* UITableView-Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51F9F3F823DFB16300A314FD /* UITableView-Extensions.swift */; }; @@ -1221,7 +1220,6 @@ 51F85BF42273625800C787DC /* Bundle-Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bundle-Extensions.swift"; sourceTree = ""; }; 51F85BF622749FA100C787DC /* UIFont-Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIFont-Extensions.swift"; sourceTree = ""; }; 51F85BF82274AA7B00C787DC /* UIBarButtonItem-Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIBarButtonItem-Extensions.swift"; sourceTree = ""; }; - 51F85BFA2275D85000C787DC /* Array-Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Array-Extensions.swift"; sourceTree = ""; }; 51F85BFC2275DCA800C787DC /* SingleLineUILabelSizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SingleLineUILabelSizer.swift; sourceTree = ""; }; 51F9F3F623DF6DB200A314FD /* ArticleIconSchemeHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleIconSchemeHandler.swift; sourceTree = ""; }; 51F9F3F823DFB16300A314FD /* UITableView-Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UITableView-Extensions.swift"; sourceTree = ""; }; @@ -1861,7 +1859,6 @@ isa = PBXGroup; children = ( 51F9F3FA23DFB25700A314FD /* Animations.swift */, - 51F85BFA2275D85000C787DC /* Array-Extensions.swift */, 51F85BF42273625800C787DC /* Bundle-Extensions.swift */, 51627A92238A3836007B3B4B /* CroppingPreviewParameters.swift */, 512AF9C1236ED52C0066F8BE /* ImageHeaderView.swift */, @@ -3927,7 +3924,6 @@ 845122742B8CEA9100480DB0 /* SidebarItem.swift in Sources */, 512E094D2268B8AB00BDCFDD /* DeleteCommand.swift in Sources */, 5110C37D2373A8D100A9C04F /* InspectorIconHeaderView.swift in Sources */, - 51F85BFB2275D85000C787DC /* Array-Extensions.swift in Sources */, 51C452AC22650FD200C03939 /* AppNotifications.swift in Sources */, 51EF0F7E2277A57D0050506E /* TimelineAccessibilityCellLayout.swift in Sources */, 51A1699B235E10D700EB091F /* AccountInspectorViewController.swift in Sources */, diff --git a/iOS/UIKit Extensions/Array-Extensions.swift b/iOS/UIKit Extensions/Array-Extensions.swift deleted file mode 100644 index 3b4bbe0cd..000000000 --- a/iOS/UIKit Extensions/Array-Extensions.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// Array-Extensions.swift -// NetNewsWire-iOS -// -// Created by Maurice Parker on 4/28/19. -// Copyright © 2019 Ranchero Software. All rights reserved. -// - -import UIKit - -extension Array where Element == CGRect { - - func maxY() -> CGFloat { - - var y: CGFloat = 0.0 - for r in self { - y = Swift.max(y, r.maxY) - } - return y - } -}