diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index 6c669259a..0a11312c6 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -14,7 +14,7 @@ 5127B23A222B4849006D641D /* DetailKeyboardShortcuts.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5127B237222B4849006D641D /* DetailKeyboardShortcuts.plist */; }; 512E08E62268800D00BDCFDD /* FolderTreeControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849A97A11ED9F180007D329B /* FolderTreeControllerDelegate.swift */; }; 512E08E72268801200BDCFDD /* FeedTreeControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849A97611ED9EB96007D329B /* FeedTreeControllerDelegate.swift */; }; - 512E09012268907400BDCFDD /* MasterTableViewSectionHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 512E08F722688F7C00BDCFDD /* MasterTableViewSectionHeader.swift */; }; + 512E09012268907400BDCFDD /* MasterFeedTableViewSectionHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 512E08F722688F7C00BDCFDD /* MasterFeedTableViewSectionHeader.swift */; }; 512E09352268B25900BDCFDD /* UISplitViewController-Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 512E092B2268B25500BDCFDD /* UISplitViewController-Extensions.swift */; }; 512E094D2268B8AB00BDCFDD /* DeleteCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84B99C9C1FAE83C600ECDEDB /* DeleteCommand.swift */; }; 5183CCD0226E1E880010922C /* NonIntrinsicLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5183CCCF226E1E880010922C /* NonIntrinsicLabel.swift */; }; @@ -50,10 +50,10 @@ 51C4525A226508D600C03939 /* UIStoryboard-Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51C4524E226506F400C03939 /* UIStoryboard-Extensions.swift */; }; 51C4525B226508DA00C03939 /* UIImage-Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51C4524F226506F400C03939 /* UIImage-Extensions.swift */; }; 51C4525C226508DF00C03939 /* String-Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51C45250226506F400C03939 /* String-Extensions.swift */; }; - 51C45268226508F600C03939 /* MasterUnreadCountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51C45261226508F600C03939 /* MasterUnreadCountView.swift */; }; - 51C45269226508F600C03939 /* MasterTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51C45262226508F600C03939 /* MasterTableViewCell.swift */; }; - 51C4526A226508F600C03939 /* MasterTableViewCellLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51C45263226508F600C03939 /* MasterTableViewCellLayout.swift */; }; - 51C4526B226508F600C03939 /* MasterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51C45264226508F600C03939 /* MasterViewController.swift */; }; + 51C45268226508F600C03939 /* MasterFeedUnreadCountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51C45261226508F600C03939 /* MasterFeedUnreadCountView.swift */; }; + 51C45269226508F600C03939 /* MasterFeedTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51C45262226508F600C03939 /* MasterFeedTableViewCell.swift */; }; + 51C4526A226508F600C03939 /* MasterFeedTableViewCellLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51C45263226508F600C03939 /* MasterFeedTableViewCellLayout.swift */; }; + 51C4526B226508F600C03939 /* MasterFeedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51C45264226508F600C03939 /* MasterFeedViewController.swift */; }; 51C452762265091600C03939 /* MasterTimelineViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51C4526E2265091600C03939 /* MasterTimelineViewController.swift */; }; 51C452772265091600C03939 /* MultilineUILabelSizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51C452702265091600C03939 /* MultilineUILabelSizer.swift */; }; 51C452782265091600C03939 /* MasterTimelineCellData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51C452712265091600C03939 /* MasterTimelineCellData.swift */; }; @@ -610,7 +610,7 @@ 5126EE96226CB48A00C22AFC /* NavigationStateController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationStateController.swift; sourceTree = ""; }; 5127B236222B4849006D641D /* DetailKeyboardDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailKeyboardDelegate.swift; sourceTree = ""; }; 5127B237222B4849006D641D /* DetailKeyboardShortcuts.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = DetailKeyboardShortcuts.plist; sourceTree = ""; }; - 512E08F722688F7C00BDCFDD /* MasterTableViewSectionHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MasterTableViewSectionHeader.swift; sourceTree = ""; }; + 512E08F722688F7C00BDCFDD /* MasterFeedTableViewSectionHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MasterFeedTableViewSectionHeader.swift; sourceTree = ""; }; 512E092B2268B25500BDCFDD /* UISplitViewController-Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UISplitViewController-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 = ""; }; @@ -623,10 +623,10 @@ 51C45250226506F400C03939 /* String-Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String-Extensions.swift"; sourceTree = ""; }; 51C45254226507D200C03939 /* AppAssets.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppAssets.swift; sourceTree = ""; }; 51C45255226507D200C03939 /* AppDefaults.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDefaults.swift; sourceTree = ""; }; - 51C45261226508F600C03939 /* MasterUnreadCountView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MasterUnreadCountView.swift; sourceTree = ""; }; - 51C45262226508F600C03939 /* MasterTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MasterTableViewCell.swift; sourceTree = ""; }; - 51C45263226508F600C03939 /* MasterTableViewCellLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MasterTableViewCellLayout.swift; sourceTree = ""; }; - 51C45264226508F600C03939 /* MasterViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MasterViewController.swift; sourceTree = ""; }; + 51C45261226508F600C03939 /* MasterFeedUnreadCountView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MasterFeedUnreadCountView.swift; sourceTree = ""; }; + 51C45262226508F600C03939 /* MasterFeedTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MasterFeedTableViewCell.swift; sourceTree = ""; }; + 51C45263226508F600C03939 /* MasterFeedTableViewCellLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MasterFeedTableViewCellLayout.swift; sourceTree = ""; }; + 51C45264226508F600C03939 /* MasterFeedViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MasterFeedViewController.swift; sourceTree = ""; }; 51C4526E2265091600C03939 /* MasterTimelineViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MasterTimelineViewController.swift; sourceTree = ""; }; 51C452702265091600C03939 /* MultilineUILabelSizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MultilineUILabelSizer.swift; sourceTree = ""; }; 51C452712265091600C03939 /* MasterTimelineCellData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MasterTimelineCellData.swift; sourceTree = ""; }; @@ -932,33 +932,33 @@ path = Extensions; sourceTree = ""; }; - 51C4525D226508F600C03939 /* Master */ = { + 51C4525D226508F600C03939 /* MasterFeed */ = { isa = PBXGroup; children = ( - 51C45264226508F600C03939 /* MasterViewController.swift */, + 51C45264226508F600C03939 /* MasterFeedViewController.swift */, 51C45260226508F600C03939 /* Cell */, ); - path = Master; + path = MasterFeed; sourceTree = ""; }; 51C45260226508F600C03939 /* Cell */ = { isa = PBXGroup; children = ( - 512E08F722688F7C00BDCFDD /* MasterTableViewSectionHeader.swift */, - 51C45262226508F600C03939 /* MasterTableViewCell.swift */, - 51C45263226508F600C03939 /* MasterTableViewCellLayout.swift */, - 51C45261226508F600C03939 /* MasterUnreadCountView.swift */, + 512E08F722688F7C00BDCFDD /* MasterFeedTableViewSectionHeader.swift */, + 51C45262226508F600C03939 /* MasterFeedTableViewCell.swift */, + 51C45263226508F600C03939 /* MasterFeedTableViewCellLayout.swift */, + 51C45261226508F600C03939 /* MasterFeedUnreadCountView.swift */, ); path = Cell; sourceTree = ""; }; - 51C4526D2265091600C03939 /* Timeline */ = { + 51C4526D2265091600C03939 /* MasterTimeline */ = { isa = PBXGroup; children = ( 51C4526E2265091600C03939 /* MasterTimelineViewController.swift */, 51C4526F2265091600C03939 /* Cell */, ); - path = Timeline; + path = MasterTimeline; sourceTree = ""; }; 51C4526F2265091600C03939 /* Cell */ = { @@ -1534,8 +1534,8 @@ 51C45254226507D200C03939 /* AppAssets.swift */, 51C45255226507D200C03939 /* AppDefaults.swift */, 5126EE96226CB48A00C22AFC /* NavigationStateController.swift */, - 51C4525D226508F600C03939 /* Master */, - 51C4526D2265091600C03939 /* Timeline */, + 51C4525D226508F600C03939 /* MasterFeed */, + 51C4526D2265091600C03939 /* MasterTimeline */, 51C4527D2265092C00C03939 /* Detail */, 51C452802265093600C03939 /* Add */, 5183CCDB226F1EEB0010922C /* Progress */, @@ -2160,7 +2160,7 @@ 84F3EE1720DEC97E003FADEB /* FeedFinder.swift in Sources */, 51C45291226509C800C03939 /* SmartFeed.swift in Sources */, 51C452A722650A3D00C03939 /* RSImage-Extensions.swift in Sources */, - 51C45269226508F600C03939 /* MasterTableViewCell.swift in Sources */, + 51C45269226508F600C03939 /* MasterFeedTableViewCell.swift in Sources */, 51C4528F226509BD00C03939 /* UnreadFeed.swift in Sources */, 5183CCDD226F1F5C0010922C /* NavigationProgressView.swift in Sources */, 51C452772265091600C03939 /* MultilineUILabelSizer.swift in Sources */, @@ -2170,7 +2170,7 @@ 51C4525C226508DF00C03939 /* String-Extensions.swift in Sources */, 51C452792265091600C03939 /* MasterTimelineTableViewCell.swift in Sources */, 51C452852265093600C03939 /* AddFeedFolderPickerData.swift in Sources */, - 51C4526B226508F600C03939 /* MasterViewController.swift in Sources */, + 51C4526B226508F600C03939 /* MasterFeedViewController.swift in Sources */, 5126EE97226CB48A00C22AFC /* NavigationStateController.swift in Sources */, 51C4525A226508D600C03939 /* UIStoryboard-Extensions.swift in Sources */, 51C452A622650A3500C03939 /* Node-Extensions.swift in Sources */, @@ -2187,7 +2187,7 @@ 51C4527C2265091600C03939 /* MasterTimelineCellLayout.swift in Sources */, 51C4529A22650A0400C03939 /* ArticleStyle.swift in Sources */, 51C4527F2265092C00C03939 /* DetailViewController.swift in Sources */, - 51C4526A226508F600C03939 /* MasterTableViewCellLayout.swift in Sources */, + 51C4526A226508F600C03939 /* MasterFeedTableViewCellLayout.swift in Sources */, 51C452AE2265104D00C03939 /* TimelineStringFormatter.swift in Sources */, 512E08E62268800D00BDCFDD /* FolderTreeControllerDelegate.swift in Sources */, 51C4529922650A0000C03939 /* ArticleStylesManager.swift in Sources */, @@ -2206,8 +2206,8 @@ 51C4527A2265091600C03939 /* SingleLineUILabelSizer.swift in Sources */, 51C4529B22650A1000C03939 /* FaviconDownloader.swift in Sources */, 5183CCE3226F314C0010922C /* ProgressTableViewController.swift in Sources */, - 512E09012268907400BDCFDD /* MasterTableViewSectionHeader.swift in Sources */, - 51C45268226508F600C03939 /* MasterUnreadCountView.swift in Sources */, + 512E09012268907400BDCFDD /* MasterFeedTableViewSectionHeader.swift in Sources */, + 51C45268226508F600C03939 /* MasterFeedUnreadCountView.swift in Sources */, 5183CCD0226E1E880010922C /* NonIntrinsicLabel.swift in Sources */, 51C452B1226510E600C03939 /* InitialFeedDownloader.swift in Sources */, 51C4529F22650A1900C03939 /* AuthorAvatarDownloader.swift in Sources */, diff --git a/iOS/Base.lproj/Main.storyboard b/iOS/Base.lproj/Main.storyboard index 638e4b65e..857809758 100644 --- a/iOS/Base.lproj/Main.storyboard +++ b/iOS/Base.lproj/Main.storyboard @@ -1,10 +1,6 @@ - - - - @@ -35,11 +31,11 @@ - + - + @@ -121,15 +117,15 @@ - + - + - + @@ -203,17 +199,17 @@ - + - + - - + + - + diff --git a/iOS/Master/Cell/MasterTableViewCell.swift b/iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift similarity index 83% rename from iOS/Master/Cell/MasterTableViewCell.swift rename to iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift index e20714e73..bf85e2e51 100644 --- a/iOS/Master/Cell/MasterTableViewCell.swift +++ b/iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift @@ -11,13 +11,13 @@ import RSCore import Account import RSTree -protocol MasterTableViewCellDelegate: class { - func disclosureSelected(_ sender: MasterTableViewCell, expanding: Bool) +protocol MasterFeedTableViewCellDelegate: class { + func disclosureSelected(_ sender: MasterFeedTableViewCell, expanding: Bool) } -class MasterTableViewCell : UITableViewCell { +class MasterFeedTableViewCell : UITableViewCell { - weak var delegate: MasterTableViewCellDelegate? + weak var delegate: MasterFeedTableViewCellDelegate? var allowDisclosureSelection = false override var accessibilityLabel: String? { @@ -96,7 +96,7 @@ class MasterTableViewCell : UITableViewCell { return UIImageView(image: AppAssets.feedImage) }() - private let unreadCountView = MasterUnreadCountView(frame: CGRect.zero) + private let unreadCountView = MasterFeedUnreadCountView(frame: CGRect.zero) private var showingEditControl = false private var disclosureButton: UIButton? @@ -113,7 +113,7 @@ class MasterTableViewCell : UITableViewCell { override func layoutSubviews() { super.layoutSubviews() let shouldShowDisclosure = !(showingEditControl && showsReorderControl) - let layout = MasterTableViewCellLayout(cellSize: bounds.size, insets: safeAreaInsets, shouldShowImage: shouldShowImage, label: titleView, unreadCountView: unreadCountView, showingEditingControl: showingEditControl, indent: indentationLevel == 1, shouldShowDisclosure: shouldShowDisclosure) + let layout = MasterFeedTableViewCellLayout(cellSize: bounds.size, insets: safeAreaInsets, shouldShowImage: shouldShowImage, label: titleView, unreadCountView: unreadCountView, showingEditingControl: showingEditControl, indent: indentationLevel == 1, shouldShowDisclosure: shouldShowDisclosure) layoutWith(layout) } @@ -126,7 +126,7 @@ class MasterTableViewCell : UITableViewCell { } -private extension MasterTableViewCell { +private extension MasterFeedTableViewCell { func commonInit() { theme() @@ -166,7 +166,7 @@ private extension MasterTableViewCell { view.translatesAutoresizingMaskIntoConstraints = false } - func layoutWith(_ layout: MasterTableViewCellLayout) { + func layoutWith(_ layout: MasterFeedTableViewCellLayout) { faviconImageView.setFrameIfNotEqual(layout.faviconRect) titleView.setFrameIfNotEqual(layout.titleRect) unreadCountView.setFrameIfNotEqual(layout.unreadCountRect) diff --git a/iOS/Master/Cell/MasterTableViewCellLayout.swift b/iOS/MasterFeed/Cell/MasterFeedTableViewCellLayout.swift similarity index 67% rename from iOS/Master/Cell/MasterTableViewCellLayout.swift rename to iOS/MasterFeed/Cell/MasterFeedTableViewCellLayout.swift index cc692740c..cb62d0d6c 100644 --- a/iOS/Master/Cell/MasterTableViewCellLayout.swift +++ b/iOS/MasterFeed/Cell/MasterFeedTableViewCellLayout.swift @@ -9,7 +9,7 @@ import UIKit import RSCore -struct MasterTableViewCellLayout { +struct MasterFeedTableViewCellLayout { private static let indent = CGFloat(integerLiteral: 14) private static let editingControlIndent = CGFloat(integerLiteral: 40) @@ -25,14 +25,14 @@ struct MasterTableViewCellLayout { let unreadCountRect: CGRect let disclosureButtonRect: CGRect - init(cellSize: CGSize, insets: UIEdgeInsets, shouldShowImage: Bool, label: UILabel, unreadCountView: MasterUnreadCountView, showingEditingControl: Bool, indent: Bool, shouldShowDisclosure: Bool) { + init(cellSize: CGSize, insets: UIEdgeInsets, shouldShowImage: Bool, label: UILabel, unreadCountView: MasterFeedUnreadCountView, showingEditingControl: Bool, indent: Bool, shouldShowDisclosure: Bool) { - var initialIndent = MasterTableViewCellLayout.marginLeft + insets.left + var initialIndent = MasterFeedTableViewCellLayout.marginLeft + insets.left if indent { - initialIndent += MasterTableViewCellLayout.indent + initialIndent += MasterFeedTableViewCellLayout.indent } if showingEditingControl { - initialIndent += MasterTableViewCellLayout.editingControlIndent + initialIndent += MasterFeedTableViewCellLayout.editingControlIndent } let bounds = CGRect(x: initialIndent, y: 0.0, width: floor(cellSize.width - initialIndent - insets.right), height: floor(cellSize.height)) @@ -40,8 +40,8 @@ struct MasterTableViewCellLayout { // Favicon var rFavicon = CGRect.zero if shouldShowImage { - rFavicon = CGRect(x: bounds.origin.x, y: 0.0, width: MasterTableViewCellLayout.imageSize.width, height: MasterTableViewCellLayout.imageSize.height) - rFavicon = MasterTableViewCellLayout.centerVertically(rFavicon, bounds) + rFavicon = CGRect(x: bounds.origin.x, y: 0.0, width: MasterFeedTableViewCellLayout.imageSize.width, height: MasterFeedTableViewCellLayout.imageSize.height) + rFavicon = MasterFeedTableViewCellLayout.centerVertically(rFavicon, bounds) } self.faviconRect = rFavicon @@ -50,12 +50,12 @@ struct MasterTableViewCellLayout { var rLabel = CGRect(x: 0.0, y: 0.0, width: labelSize.width, height: labelSize.height) if shouldShowImage { - rLabel.origin.x = rFavicon.maxX + MasterTableViewCellLayout.imageMarginRight + rLabel.origin.x = rFavicon.maxX + MasterFeedTableViewCellLayout.imageMarginRight } else { rLabel.origin.x = bounds.minX } - rLabel = MasterTableViewCellLayout.centerVertically(rLabel, bounds) + rLabel = MasterFeedTableViewCellLayout.centerVertically(rLabel, bounds) // Unread Count let unreadCountSize = unreadCountView.intrinsicContentSize @@ -66,11 +66,11 @@ struct MasterTableViewCellLayout { rUnread.size = unreadCountSize rUnread.origin.x = bounds.maxX - - (unreadCountSize.width + MasterTableViewCellLayout.unreadCountMarginRight + MasterTableViewCellLayout.disclosureButtonSize.width) - rUnread = MasterTableViewCellLayout.centerVertically(rUnread, bounds) + (unreadCountSize.width + MasterFeedTableViewCellLayout.unreadCountMarginRight + MasterFeedTableViewCellLayout.disclosureButtonSize.width) + rUnread = MasterFeedTableViewCellLayout.centerVertically(rUnread, bounds) // Cap the Title width based on the unread indicator button - let labelMaxX = rUnread.minX - MasterTableViewCellLayout.unreadCountMarginLeft + let labelMaxX = rUnread.minX - MasterFeedTableViewCellLayout.unreadCountMarginLeft if rLabel.maxX > labelMaxX { rLabel.size.width = labelMaxX - rLabel.minX } @@ -82,9 +82,9 @@ struct MasterTableViewCellLayout { var rDisclosure = CGRect.zero if shouldShowDisclosure { - rDisclosure.size = MasterTableViewCellLayout.disclosureButtonSize - rDisclosure.origin.x = bounds.maxX - MasterTableViewCellLayout.disclosureButtonSize.width - rDisclosure = MasterTableViewCellLayout.centerVertically(rDisclosure, bounds) + rDisclosure.size = MasterFeedTableViewCellLayout.disclosureButtonSize + rDisclosure.origin.x = bounds.maxX - MasterFeedTableViewCellLayout.disclosureButtonSize.width + rDisclosure = MasterFeedTableViewCellLayout.centerVertically(rDisclosure, bounds) // Cap the Title width based on the disclosure button let labelMaxX = rDisclosure.minX diff --git a/iOS/Master/Cell/MasterTableViewSectionHeader.swift b/iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift similarity index 82% rename from iOS/Master/Cell/MasterTableViewSectionHeader.swift rename to iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift index 08b4c597c..d7976eb3a 100644 --- a/iOS/Master/Cell/MasterTableViewSectionHeader.swift +++ b/iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift @@ -8,7 +8,7 @@ import UIKit -class MasterTableViewSectionHeader: UITableViewHeaderFooterView { +class MasterFeedTableViewSectionHeader: UITableViewHeaderFooterView { override var accessibilityLabel: String? { set {} @@ -63,7 +63,7 @@ class MasterTableViewSectionHeader: UITableViewHeaderFooterView { return label }() - private let unreadCountView = MasterUnreadCountView(frame: CGRect.zero) + private let unreadCountView = MasterFeedUnreadCountView(frame: CGRect.zero) private var disclosureView: UIImageView = { let iView = UIImageView() iView.contentMode = .center @@ -82,14 +82,14 @@ class MasterTableViewSectionHeader: UITableViewHeaderFooterView { override func layoutSubviews() { super.layoutSubviews() - let layout = MasterTableViewCellLayout(cellSize: bounds.size, insets: safeAreaInsets, shouldShowImage: false, label: titleView, unreadCountView: unreadCountView, showingEditingControl: false, indent: true, shouldShowDisclosure: true) + let layout = MasterFeedTableViewCellLayout(cellSize: bounds.size, insets: safeAreaInsets, shouldShowImage: false, label: titleView, unreadCountView: unreadCountView, showingEditingControl: false, indent: true, shouldShowDisclosure: true) layoutWith(layout) } } -private extension MasterTableViewSectionHeader { +private extension MasterFeedTableViewSectionHeader { func commonInit() { let view = UIView() @@ -114,7 +114,7 @@ private extension MasterTableViewSectionHeader { view.translatesAutoresizingMaskIntoConstraints = false } - func layoutWith(_ layout: MasterTableViewCellLayout) { + func layoutWith(_ layout: MasterFeedTableViewCellLayout) { titleView.setFrameIfNotEqual(layout.titleRect) unreadCountView.setFrameIfNotEqual(layout.unreadCountRect) disclosureView.setFrameIfNotEqual(layout.disclosureButtonRect) diff --git a/iOS/Master/Cell/MasterUnreadCountView.swift b/iOS/MasterFeed/Cell/MasterFeedUnreadCountView.swift similarity index 98% rename from iOS/Master/Cell/MasterUnreadCountView.swift rename to iOS/MasterFeed/Cell/MasterFeedUnreadCountView.swift index 916356696..4cfd904ea 100644 --- a/iOS/Master/Cell/MasterUnreadCountView.swift +++ b/iOS/MasterFeed/Cell/MasterFeedUnreadCountView.swift @@ -16,7 +16,7 @@ private let textFont = UIFont.systemFont(ofSize: 11.0, weight: UIFont.Weight.sem private var textAttributes: [NSAttributedString.Key: AnyObject] = [NSAttributedString.Key.foregroundColor: textColor, NSAttributedString.Key.font: textFont, NSAttributedString.Key.kern: NSNull()] private var textSizeCache = [Int: CGSize]() -class MasterUnreadCountView : UIView { +class MasterFeedUnreadCountView : UIView { var unreadCount = 0 { didSet { diff --git a/iOS/Master/MasterViewController.swift b/iOS/MasterFeed/MasterFeedViewController.swift similarity index 94% rename from iOS/Master/MasterViewController.swift rename to iOS/MasterFeed/MasterFeedViewController.swift index 99533b0d7..c1e4952b1 100644 --- a/iOS/Master/MasterViewController.swift +++ b/iOS/MasterFeed/MasterFeedViewController.swift @@ -12,7 +12,7 @@ import Articles import RSCore import RSTree -class MasterViewController: ProgressTableViewController, UndoableCommandRunner { +class MasterFeedViewController: ProgressTableViewController, UndoableCommandRunner { @IBOutlet weak var markAllAsReadButton: UIBarButtonItem! @@ -29,7 +29,7 @@ class MasterViewController: ProgressTableViewController, UndoableCommandRunner { navigationItem.rightBarButtonItem = editButtonItem - tableView.register(MasterTableViewSectionHeader.self, forHeaderFooterViewReuseIdentifier: "SectionHeader") + tableView.register(MasterFeedTableViewSectionHeader.self, forHeaderFooterViewReuseIdentifier: "SectionHeader") NotificationCenter.default.addObserver(self, selector: #selector(unreadCountDidChange(_:)), name: .UnreadCountDidChange, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(faviconDidBecomeAvailable(_:)), name: .FaviconDidBecomeAvailable, object: nil) @@ -76,7 +76,7 @@ class MasterViewController: ProgressTableViewController, UndoableCommandRunner { if let account = representedObject as? Account { if let node = navState.rootNode.childNodeRepresentingObject(account) { let sectionIndex = navState.rootNode.indexOfChild(node)! - if let headerView = tableView.headerView(forSection: sectionIndex) as? MasterTableViewSectionHeader { + if let headerView = tableView.headerView(forSection: sectionIndex) as? MasterFeedTableViewSectionHeader { headerView.unreadCount = account.unreadCount } } @@ -161,7 +161,7 @@ class MasterViewController: ProgressTableViewController, UndoableCommandRunner { return nil } - let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! MasterTableViewSectionHeader + let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! MasterFeedTableViewSectionHeader headerView.name = nameProvider.nameForDisplay guard let sectionNode = navState.rootNode.childAtIndex(section) else { @@ -194,7 +194,7 @@ class MasterViewController: ProgressTableViewController, UndoableCommandRunner { override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! MasterTableViewCell + let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! MasterFeedTableViewCell guard let node = navState.nodeFor(indexPath) else { return cell @@ -446,7 +446,7 @@ class MasterViewController: ProgressTableViewController, UndoableCommandRunner { guard let sectionIndex = sender.view?.tag, let sectionNode = navState.rootNode.childAtIndex(sectionIndex), - let headerView = sender.view as? MasterTableViewSectionHeader + let headerView = sender.view as? MasterFeedTableViewSectionHeader else { return } @@ -471,7 +471,7 @@ class MasterViewController: ProgressTableViewController, UndoableCommandRunner { // MARK: API - func configure(_ cell: MasterTableViewCell, _ node: Node) { + func configure(_ cell: MasterFeedTableViewCell, _ node: Node) { cell.delegate = self if node.parent?.representedObject is Folder { @@ -489,11 +489,11 @@ class MasterViewController: ProgressTableViewController, UndoableCommandRunner { } - func configureUnreadCount(_ cell: MasterTableViewCell, _ node: Node) { + func configureUnreadCount(_ cell: MasterFeedTableViewCell, _ node: Node) { cell.unreadCount = unreadCountFor(node) } - func configureFavicon(_ cell: MasterTableViewCell, _ node: Node) { + func configureFavicon(_ cell: MasterFeedTableViewCell, _ node: Node) { cell.faviconImage = imageFor(node) } @@ -581,7 +581,7 @@ class MasterViewController: ProgressTableViewController, UndoableCommandRunner { // MARK: OPML Document Picker -extension MasterViewController: UIDocumentPickerDelegate { +extension MasterFeedViewController: UIDocumentPickerDelegate { func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) { @@ -599,9 +599,9 @@ extension MasterViewController: UIDocumentPickerDelegate { // MARK: MasterTableViewCellDelegate -extension MasterViewController: MasterTableViewCellDelegate { +extension MasterFeedViewController: MasterFeedTableViewCellDelegate { - func disclosureSelected(_ sender: MasterTableViewCell, expanding: Bool) { + func disclosureSelected(_ sender: MasterFeedTableViewCell, expanding: Bool) { if expanding { expand(sender) } else { @@ -613,7 +613,7 @@ extension MasterViewController: MasterTableViewCellDelegate { // MARK: Private -private extension MasterViewController { +private extension MasterFeedViewController { @objc private func refreshAccounts(_ sender: Any) { AccountManager.shared.refreshAll() @@ -633,7 +633,7 @@ private extension MasterViewController { applyToCellsForRepresentedObject(representedObject, configureUnreadCount) } - func applyToCellsForRepresentedObject(_ representedObject: AnyObject, _ callback: (MasterTableViewCell, Node) -> Void) { + func applyToCellsForRepresentedObject(_ representedObject: AnyObject, _ callback: (MasterFeedTableViewCell, Node) -> Void) { applyToAvailableCells { (cell, node) in if node.representedObject === representedObject { callback(cell, node) @@ -641,12 +641,12 @@ private extension MasterViewController { } } - func applyToAvailableCells(_ callback: (MasterTableViewCell, Node) -> Void) { + func applyToAvailableCells(_ callback: (MasterFeedTableViewCell, Node) -> Void) { tableView.visibleCells.forEach { cell in guard let indexPath = tableView.indexPath(for: cell), let node = navState.nodeFor(indexPath) else { return } - callback(cell as! MasterTableViewCell, node) + callback(cell as! MasterFeedTableViewCell, node) } } @@ -663,7 +663,7 @@ private extension MasterViewController { return nil } - func expand(_ cell: MasterTableViewCell) { + func expand(_ cell: MasterFeedTableViewCell) { guard let indexPath = tableView.indexPath(for: cell) else { return } @@ -674,7 +674,7 @@ private extension MasterViewController { } } - func collapse(_ cell: MasterTableViewCell) { + func collapse(_ cell: MasterFeedTableViewCell) { guard let indexPath = tableView.indexPath(for: cell) else { return } diff --git a/iOS/Timeline/Cell/MasterTimelineCellData.swift b/iOS/MasterTimeline/Cell/MasterTimelineCellData.swift similarity index 100% rename from iOS/Timeline/Cell/MasterTimelineCellData.swift rename to iOS/MasterTimeline/Cell/MasterTimelineCellData.swift diff --git a/iOS/Timeline/Cell/MasterTimelineCellLayout.swift b/iOS/MasterTimeline/Cell/MasterTimelineCellLayout.swift similarity index 100% rename from iOS/Timeline/Cell/MasterTimelineCellLayout.swift rename to iOS/MasterTimeline/Cell/MasterTimelineCellLayout.swift diff --git a/iOS/Timeline/Cell/MasterTimelineTableViewCell.swift b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift similarity index 100% rename from iOS/Timeline/Cell/MasterTimelineTableViewCell.swift rename to iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift diff --git a/iOS/Timeline/Cell/MasterUnreadIndicatorView.swift b/iOS/MasterTimeline/Cell/MasterUnreadIndicatorView.swift similarity index 100% rename from iOS/Timeline/Cell/MasterUnreadIndicatorView.swift rename to iOS/MasterTimeline/Cell/MasterUnreadIndicatorView.swift diff --git a/iOS/Timeline/Cell/MultilineUILabelSizer.swift b/iOS/MasterTimeline/Cell/MultilineUILabelSizer.swift similarity index 100% rename from iOS/Timeline/Cell/MultilineUILabelSizer.swift rename to iOS/MasterTimeline/Cell/MultilineUILabelSizer.swift diff --git a/iOS/Timeline/Cell/SingleLineUILabelSizer.swift b/iOS/MasterTimeline/Cell/SingleLineUILabelSizer.swift similarity index 100% rename from iOS/Timeline/Cell/SingleLineUILabelSizer.swift rename to iOS/MasterTimeline/Cell/SingleLineUILabelSizer.swift diff --git a/iOS/Timeline/MasterTimelineViewController.swift b/iOS/MasterTimeline/MasterTimelineViewController.swift similarity index 100% rename from iOS/Timeline/MasterTimelineViewController.swift rename to iOS/MasterTimeline/MasterTimelineViewController.swift