Skip to content

Commit 6d545b1

Browse files
committed
Semantic naming fix for ViewControllers
Refactor screen controller to include 'ViewController' in name
1 parent 165965a commit 6d545b1

37 files changed

+239
-246
lines changed

Pods/Pods.xcodeproj/xcuserdata/pran1999.xcuserdatad/xcschemes/xcschememanagement.plist

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ReusableSource/ReusableSource.xcodeproj/xcuserdata/pran1999.xcuserdatad/xcschemes/xcschememanagement.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<key>ReusableSource.xcscheme_^#shared#^_</key>
1313
<dict>
1414
<key>orderHint</key>
15-
<integer>9</integer>
15+
<integer>10</integer>
1616
</dict>
1717
</dict>
1818
</dict>

SakaiClientiOS.xcodeproj/project.pbxproj

Lines changed: 92 additions & 80 deletions
Large diffs are not rendered by default.

SakaiClientiOS/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleShortVersionString</key>
2020
<string>1.2.0</string>
2121
<key>CFBundleVersion</key>
22-
<string>1563</string>
22+
<string>1566</string>
2323
<key>Fabric</key>
2424
<dict>
2525
<key>APIKey</key>

SakaiClientiOS/Sources/Announcement/AnnouncementPageController.swift renamed to SakaiClientiOS/Sources/Announcement/AnnouncementPageViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
//
2-
// AnnouncementPageController.swift
2+
// AnnouncementPageViewController.swift
33
// SakaiClientiOS
44
//
55
// Created by Pranay Neelagiri on 7/8/18.
66
//
77

88
import UIKit
99

10-
class AnnouncementPageController: UIViewController {
10+
class AnnouncementPageViewController: UIViewController {
1111

1212
var announcementPageView: PageView<AnnouncementPageView> = PageView(frame: .zero)
1313

SakaiClientiOS/Sources/Announcement/AnnouncementView.storyboard

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
3-
<device id="retina4_7" orientation="portrait">
4-
<adaptation id="fullscreen"/>
5-
</device>
63
<dependencies>
7-
<deployment identifier="iOS"/>
84
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
95
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
106
</dependencies>
117
<scenes>
128
<!--Announcements-->
139
<scene sceneID="TL1-5s-KOk">
1410
<objects>
15-
<tableViewController storyboardIdentifier="AnnouncementView" title="Announcements" id="ZQn-db-h8h" customClass="AnnouncementController" customModule="SakaiClientiOS" customModuleProvider="target" sceneMemberID="viewController">
11+
<tableViewController storyboardIdentifier="AnnouncementView" title="Announcements" id="ZQn-db-h8h" customClass="AnnouncementsViewController" customModule="SakaiClientiOS" customModuleProvider="target" sceneMemberID="viewController">
1612
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="EP6-zb-fO0">
17-
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
13+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
1814
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1915
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
2016
<color key="tintColor" red="0.78039215689999997" green="0.1450980392" blue="0.30588235289999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2117
<color key="separatorColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
2218
<prototypes>
2319
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="h2z-PG-See">
24-
<rect key="frame" x="0.0" y="28" width="375" height="44"/>
20+
<rect key="frame" x="0.0" y="28" width="600" height="44"/>
2521
<autoresizingMask key="autoresizingMask"/>
2622
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="h2z-PG-See" id="Z02-Si-Fvy">
27-
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
23+
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
2824
<autoresizingMask key="autoresizingMask"/>
2925
</tableViewCellContentView>
3026
</tableViewCell>

SakaiClientiOS/Sources/Announcement/AnnouncementController.swift renamed to SakaiClientiOS/Sources/Announcement/AnnouncementsViewController.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// AnnouncementController.swift
2+
// AnnouncementsViewController.swift
33
// SakaiClientiOS
44
//
55
// Created by Pranay Neelagiri on 4/26/18.
@@ -9,7 +9,7 @@ import UIKit
99
import ReusableSource
1010

1111
/// ViewController for user's entire Announcement feed
12-
class AnnouncementController: UITableViewController {
12+
class AnnouncementsViewController: UITableViewController {
1313

1414
private(set) lazy var announcementTableManager = AnnouncementTableManager(tableView: tableView)
1515

@@ -19,7 +19,7 @@ class AnnouncementController: UITableViewController {
1919
guard let announcement = self.announcementTableManager.item(at: indexPath) else {
2020
return
2121
}
22-
let announcementPage = AnnouncementPageController(announcement: announcement)
22+
let announcementPage = AnnouncementPageViewController(announcement: announcement)
2323
self.navigationController?.pushViewController(announcementPage, animated: true)
2424
}
2525
announcementTableManager.delegate = self
@@ -30,12 +30,12 @@ class AnnouncementController: UITableViewController {
3030

3131
//MARK: LoadableController Extension
3232

33-
extension AnnouncementController: LoadableController {
33+
extension AnnouncementsViewController: LoadableController {
3434
@objc func loadData() {
3535
announcementTableManager.loadDataSourceWithoutCache()
3636
}
3737
}
3838

3939
//MARK: NetworkSourceDelegate Extension
4040

41-
extension AnnouncementController: NetworkSourceDelegate {}
41+
extension AnnouncementsViewController: NetworkSourceDelegate {}

SakaiClientiOS/Sources/Announcement/SiteAnnouncementController.swift renamed to SakaiClientiOS/Sources/Announcement/SiteAnnouncementsViewController.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// SiteAnnouncementController.swift
2+
// SiteAnnouncementsViewController.swift
33
// SakaiClientiOS
44
//
55
// Created by Pranay Neelagiri on 7/19/18.
@@ -8,7 +8,7 @@
88
import ReusableSource
99

1010
/// View controller for Site Announcements feed
11-
class SiteAnnouncementController: UITableViewController {
11+
class SiteAnnouncementsViewController: UITableViewController {
1212

1313
private let siteId: String
1414

@@ -35,7 +35,7 @@ class SiteAnnouncementController: UITableViewController {
3535
guard let announcement = self.announcementTableManager.item(at: indexPath) else {
3636
return
3737
}
38-
let announcementPage = AnnouncementPageController(announcement: announcement)
38+
let announcementPage = AnnouncementPageViewController(announcement: announcement)
3939
self.navigationController?.pushViewController(announcementPage, animated: true)
4040
}
4141
announcementTableManager.delegate = self
@@ -53,12 +53,12 @@ class SiteAnnouncementController: UITableViewController {
5353

5454
//MARK: LoadableController Extension
5555

56-
extension SiteAnnouncementController: LoadableController {
56+
extension SiteAnnouncementsViewController: LoadableController {
5757
@objc func loadData() {
5858
announcementTableManager.loadDataSourceWithoutCache()
5959
}
6060
}
6161

6262
//MARK: NetworkSourceDelegate Extension
6363

64-
extension SiteAnnouncementController: NetworkSourceDelegate {}
64+
extension SiteAnnouncementsViewController: NetworkSourceDelegate {}

SakaiClientiOS/Sources/AppDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2525
let root = window?.rootViewController as? UITabBarController
2626
root?.childViewControllers.forEach { child in
2727
let nav = child as? UINavigationController
28-
if let home = nav?.viewControllers.first as? HomeController {
28+
if let home = nav?.viewControllers.first as? HomeViewController {
2929
home.loginService = RequestManager.shared
3030
}
3131
}
@@ -166,7 +166,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
166166
return
167167
}
168168
guard
169-
let loginController = navController.viewControllers.first as? LoginController
169+
let loginController = navController.viewControllers.first as? LoginViewController
170170
else {
171171
return
172172
}

SakaiClientiOS/Sources/Assignment/AssignmentCollectionManager.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ class AssignmentCollectionManager: ReusableCollectionManager<SingleSectionDataPr
8484

8585
// MARK: PageDelegate Extension
8686

87-
extension AssignmentCollectionManager: PagesControllerDelegate {
87+
extension AssignmentCollectionManager: AssignmentPagesViewControllerDelegate {
8888

89-
func pageController(_ pageController: PagesController, didMoveToIndex index: Int) {
89+
func pageController(_ pageController: AssignmentPagesViewController, didMoveToIndex index: Int) {
9090
selectedCell?.flip(withDirection: .toFront, animated: false, completion: {})
9191
selectedCell = nil
9292
let indexPath = IndexPath(row: index, section: 0)

SakaiClientiOS/Sources/Assignment/AssignmentPageController.swift renamed to SakaiClientiOS/Sources/Assignment/AssignmentPageViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import UIKit
99

1010
/// Display a full page Assignment view
11-
class AssignmentPageController: UIViewController {
11+
class AssignmentPageViewController: UIViewController {
1212

1313
private let assignment: Assignment
1414
private var pageView: PageView<AssignmentPageView> = PageView(frame: .zero)

SakaiClientiOS/Sources/Assignment/PagesController.swift renamed to SakaiClientiOS/Sources/Assignment/AssignmentPagesViewController.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// PagesController.swift
2+
// AssignmentPagesViewController.swift
33
// SakaiClientiOS
44
//
55
// Created by Pranay Neelagiri on 6/17/18.
@@ -11,7 +11,7 @@ import SafariServices
1111

1212
/// The container view controller allowing pagination between multiple
1313
/// Assignments
14-
class PagesController: UIViewController {
14+
class AssignmentPagesViewController: UIViewController {
1515

1616
private let pageControl: UIPageControl = {
1717
let pageControl = UIPageControl()
@@ -26,9 +26,9 @@ class PagesController: UIViewController {
2626

2727
// Even when the current Assignment changes, the popup controller
2828
// instance will be the same but the popup URL will change
29-
private let webController = WebController(allowsOptions: false)
29+
private let webController = WebViewController(allowsOptions: false)
3030
private lazy var popupController = WebViewNavigationController(rootViewController: webController)
31-
private let submitPopupBarController = SubmitPopupBarController()
31+
private let submitPopupBarController = SubmitPopupBarViewController()
3232

3333
private var pendingIndex: Int?
3434
private var pages: [UIViewController?]
@@ -37,7 +37,7 @@ class PagesController: UIViewController {
3737

3838
private var bottomConstraint, topConstraint: NSLayoutConstraint?
3939

40-
weak var delegate: PagesControllerDelegate?
40+
weak var delegate: AssignmentPagesViewControllerDelegate?
4141

4242
init(assignments: [Assignment], start: Int) {
4343
self.assignments = assignments
@@ -100,7 +100,7 @@ class PagesController: UIViewController {
100100
super.viewWillDisappear(animated)
101101
navigationController?.setToolbarHidden(true, animated: false)
102102
navigationController?.interactivePopGestureRecognizer?.isEnabled = true;
103-
guard let tabBarController = tabBarController as? TabController else {
103+
guard let tabBarController = tabBarController as? TabsController else {
104104
return
105105
}
106106
tabBarController.popupController = nil
@@ -118,7 +118,7 @@ class PagesController: UIViewController {
118118

119119
navigationController?.interactivePopGestureRecognizer?.isEnabled = false;
120120

121-
guard let tabBarController = tabBarController as? TabController else {
121+
guard let tabBarController = tabBarController as? TabsController else {
122122
return
123123
}
124124
tabBarController.popupController = popupController
@@ -136,7 +136,7 @@ class PagesController: UIViewController {
136136
}
137137
}
138138

139-
extension PagesController: UIPageViewControllerDataSource, UIPageViewControllerDelegate {
139+
extension AssignmentPagesViewController: UIPageViewControllerDataSource, UIPageViewControllerDelegate {
140140
func pageViewController(_ pageViewController: UIPageViewController,
141141
viewControllerBefore viewController: UIViewController) -> UIViewController? {
142142

@@ -194,7 +194,7 @@ extension PagesController: UIPageViewControllerDataSource, UIPageViewControllerD
194194
}
195195

196196
private func setPage(assignment: Assignment, index: Int) {
197-
let page = AssignmentPageController(assignment: assignment)
197+
let page = AssignmentPageViewController(assignment: assignment)
198198
page.textViewDelegate = self
199199
page.scrollViewDelegate = self
200200
pages[index] = page
@@ -213,7 +213,7 @@ extension PagesController: UIPageViewControllerDataSource, UIPageViewControllerD
213213

214214
// MARK: Animatable Extension
215215

216-
extension PagesController: Animatable {
216+
extension AssignmentPagesViewController: Animatable {
217217
var containerView: UIView? {
218218
return view
219219
}
@@ -239,9 +239,9 @@ extension PagesController: Animatable {
239239
}
240240
}
241241

242-
extension PagesController: NavigationAnimatable {
242+
extension AssignmentPagesViewController: NavigationAnimatable {
243243
func animationControllerForPop(to controller: UIViewController) -> UIViewControllerAnimatedTransitioning? {
244-
if controller is AssignmentController || controller is SiteAssignmentController {
244+
if controller is AssignmentsViewController || controller is SiteAssignmentsViewController {
245245
return CollapseDismissAnimationController(resizingDuration: 0.5)
246246
}
247247
return nil

SakaiClientiOS/Sources/Assignment/PageControllerDelegate.swift renamed to SakaiClientiOS/Sources/Assignment/AssignmentPagesViewControllerDelegate.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// PageDelegate.swift
2+
// AssignmentPagesViewControllerDelegate.swift
33
// SakaiClientiOS
44
//
55
// Created by Pranay Neelagiri on 12/25/18.
@@ -15,6 +15,6 @@ import UIKit
1515
/// This is primarily used to sync the collection view in the previous
1616
/// screen with the UIPageController, so the transition back occurs in
1717
/// context
18-
protocol PagesControllerDelegate: class {
19-
func pageController(_ pageController: PagesController, didMoveToIndex index: Int)
18+
protocol AssignmentPagesViewControllerDelegate: class {
19+
func pageController(_ pageController: AssignmentPagesViewController, didMoveToIndex index: Int)
2020
}

SakaiClientiOS/Sources/Assignment/AssignmentView.storyboard

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
3-
<device id="retina4_7" orientation="portrait">
4-
<adaptation id="fullscreen"/>
5-
</device>
63
<dependencies>
7-
<deployment identifier="iOS"/>
84
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
95
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
106
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -13,18 +9,18 @@
139
<!--Assignments-->
1410
<scene sceneID="jm2-3G-4GA">
1511
<objects>
16-
<tableViewController storyboardIdentifier="AssignmentView" title="Assignments" id="mkx-CP-iJe" customClass="AssignmentController" customModule="SakaiClientiOS" customModuleProvider="target" sceneMemberID="viewController">
12+
<tableViewController storyboardIdentifier="AssignmentView" title="Assignments" id="mkx-CP-iJe" customClass="AssignmentsViewController" customModule="SakaiClientiOS" customModuleProvider="target" sceneMemberID="viewController">
1713
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="1un-XO-lKL">
18-
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
14+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
1915
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2016
<color key="backgroundColor" white="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
2117
<color key="tintColor" red="0.78039215689999997" green="0.1450980392" blue="0.30588235289999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2218
<prototypes>
2319
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="cas-uV-yBh">
24-
<rect key="frame" x="0.0" y="55.5" width="375" height="44"/>
20+
<rect key="frame" x="0.0" y="55.5" width="600" height="44"/>
2521
<autoresizingMask key="autoresizingMask"/>
2622
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="cas-uV-yBh" id="gOH-Ak-4iX">
27-
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
23+
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
2824
<autoresizingMask key="autoresizingMask"/>
2925
</tableViewCellContentView>
3026
</tableViewCell>
@@ -44,11 +40,11 @@
4440
<objects>
4541
<viewController storyboardIdentifier="filter" modalPresentationStyle="overCurrentContext" id="ed2-FX-EbF" customClass="FilterViewController" customModule="SakaiClientiOS" customModuleProvider="target" sceneMemberID="viewController">
4642
<view key="view" contentMode="scaleToFill" id="4BM-6d-Hyf">
47-
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
43+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
4844
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
4945
<subviews>
5046
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qvM-tz-HHz">
51-
<rect key="frame" x="73" y="218.5" width="229" height="250"/>
47+
<rect key="frame" x="185.5" y="185" width="229" height="250"/>
5248
<subviews>
5349
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Fvo-Gg-7aQ">
5450
<rect key="frame" x="0.0" y="205" width="229" height="45"/>

0 commit comments

Comments
 (0)