Skip to content

Commit cd3eb73

Browse files
committed
Disambiguate Notification usages — / Notification\?/
1 parent 85a1bfc commit cd3eb73

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

WordPress/Classes/ViewRelated/Comments/Controllers/CommentDetailViewController.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class CommentDetailViewController: UIViewController, NoResultsViewHost {
4747
}
4848
}
4949
}
50-
private var notification: Notification?
50+
private var notification: WordPressData.Notification?
5151
private let helper = ReaderCommentsHelper()
5252

5353
private var isNotificationComment: Bool {

WordPress/Classes/ViewRelated/Comments/Views/Detail/CommentCellViewModel.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import WordPressShared
55
final class CommentCellViewModel: NSObject {
66
@objc let comment: Comment
77

8-
private let notification: Notification?
8+
private let notification: WordPressData.Notification?
99
private let coreDataStack = ContextManager.shared
1010

1111
@Published private(set) var content: String?
1212
@Published private(set) var avatar: Avatar?
1313
@Published private(set) var state: State
1414

15-
init(comment: Comment, notification: Notification? = nil) {
15+
init(comment: Comment, notification: WordPressData.Notification? = nil) {
1616
self.comment = comment
1717
self.notification = notification
1818

WordPress/Classes/ViewRelated/Likes/LikesListController.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class LikesListController: NSObject {
2727
private let formatter = FormattableContentFormatter()
2828
private let content: ContentIdentifier
2929
private let siteID: NSNumber
30-
private var notification: Notification? = nil
30+
private var notification: WordPressData.Notification? = nil
3131
private var readerPost: ReaderPost? = nil
3232
private let tableView: UITableView
3333
private var loadingIndicator = UIActivityIndicatorView()

WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationDetailsViewController.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import FormattableContentKit
99
///
1010
///
1111
protocol NotificationsNavigationDataSource: AnyObject {
12-
func notification(succeeding note: WordPressData.Notification) -> Notification?
13-
func notification(preceding note: WordPressData.Notification) -> Notification?
12+
func notification(succeeding note: WordPressData.Notification) -> WordPressData.Notification?
13+
func notification(preceding note: WordPressData.Notification) -> WordPressData.Notification?
1414
}
1515

1616
// MARK: - Renders a given Notification entity, onscreen

WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController/NotificationsViewController.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class NotificationsViewController: UIViewController, UITableViewDataSource, UITa
7979
/// Used to keep track of the currently selected notification,
8080
/// to restore it between table view reloads and state restoration.
8181
///
82-
fileprivate var selectedNotification: Notification? = nil
82+
fileprivate var selectedNotification: WordPressData.Notification? = nil
8383

8484
/// JetpackLoginVC being presented.
8585
///
@@ -1002,7 +1002,7 @@ private extension NotificationsViewController {
10021002
syncDeletedNotification(notification)
10031003
}
10041004

1005-
func syncDeletedNotification(_ notification: Notification?) {
1005+
func syncDeletedNotification(_ notification: WordPressData.Notification?) {
10061006
guard let notification else {
10071007
return
10081008
}
@@ -1680,13 +1680,13 @@ private extension NotificationsViewController {
16801680
viewModel.lastSeenChanged(timestamp: note.timestamp)
16811681
}
16821682

1683-
func loadNotification(with noteId: String) -> Notification? {
1683+
func loadNotification(with noteId: String) -> WordPressData.Notification? {
16841684
let predicate = NSPredicate(format: "(notificationId == %@)", noteId)
16851685

16861686
return mainContext.firstObject(ofType: Notification.self, matching: predicate)
16871687
}
16881688

1689-
func loadNotification(near note: Notification, withIndexDelta delta: Int) -> Notification? {
1689+
func loadNotification(near note: Notification, withIndexDelta delta: Int) -> WordPressData.Notification? {
16901690
guard let notifications = tableViewHandler?.resultsController?.fetchedObjects as? [Notification] else {
16911691
return nil
16921692
}
@@ -1718,11 +1718,11 @@ private extension NotificationsViewController {
17181718
// MARK: - Details Navigation Datasource
17191719
//
17201720
extension NotificationsViewController: NotificationsNavigationDataSource {
1721-
@objc func notification(succeeding note: WordPressData.Notification) -> Notification? {
1721+
@objc func notification(succeeding note: WordPressData.Notification) -> WordPressData.Notification? {
17221722
return loadNotification(near: note, withIndexDelta: -1)
17231723
}
17241724

1725-
@objc func notification(preceding note: WordPressData.Notification) -> Notification? {
1725+
@objc func notification(preceding note: WordPressData.Notification) -> WordPressData.Notification? {
17261726
return loadNotification(near: note, withIndexDelta: +1)
17271727
}
17281728
}

WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController/NotificationsViewModel.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ final class NotificationsViewModel {
8585
near note: Notification,
8686
allNotifications: [Notification],
8787
withIndexDelta delta: Int
88-
) -> Notification? {
88+
) -> WordPressData.Notification? {
8989
guard let noteIndex = allNotifications.firstIndex(of: note) else {
9090
return nil
9191
}

WordPress/Classes/ViewRelated/Notifications/Tools/NotificationCommentDetailCoordinator.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import WordPressShared
44
// This facilitates showing the CommentDetailViewController within the context of Notifications.
55

66
protocol CommentDetailsNotificationDelegate: AnyObject {
7-
func previousNotificationTapped(current: Notification?)
8-
func nextNotificationTapped(current: Notification?)
9-
func commentWasModerated(for notification: Notification?)
7+
func previousNotificationTapped(current: WordPressData.Notification?)
8+
func nextNotificationTapped(current: WordPressData.Notification?)
9+
func commentWasModerated(for notification: WordPressData.Notification?)
1010
}
1111

1212
class NotificationCommentDetailCoordinator: NSObject {
@@ -16,7 +16,7 @@ class NotificationCommentDetailCoordinator: NSObject {
1616
private var viewController: NotificationCommentDetailViewController?
1717
private let managedObjectContext = ContextManager.shared.mainContext
1818

19-
private var notification: Notification? {
19+
private var notification: WordPressData.Notification? {
2020
didSet {
2121
markNotificationReadIfNeeded()
2222
}
@@ -137,7 +137,7 @@ private extension NotificationCommentDetailCoordinator {
137137

138138
extension NotificationCommentDetailCoordinator: CommentDetailsNotificationDelegate {
139139

140-
func previousNotificationTapped(current: Notification?) {
140+
func previousNotificationTapped(current: WordPressData.Notification?) {
141141
guard let current,
142142
let previousNotification = notificationsNavigationDataSource?.notification(preceding: current) else {
143143
return
@@ -147,7 +147,7 @@ extension NotificationCommentDetailCoordinator: CommentDetailsNotificationDelega
147147
updateViewWith(notification: previousNotification)
148148
}
149149

150-
func nextNotificationTapped(current: Notification?) {
150+
func nextNotificationTapped(current: WordPressData.Notification?) {
151151
guard let current,
152152
let nextNotification = notificationsNavigationDataSource?.notification(succeeding: current) else {
153153
return
@@ -157,7 +157,7 @@ extension NotificationCommentDetailCoordinator: CommentDetailsNotificationDelega
157157
updateViewWith(notification: nextNotification)
158158
}
159159

160-
func commentWasModerated(for notification: Notification?) {
160+
func commentWasModerated(for notification: WordPressData.Notification?) {
161161
guard let notification,
162162
!notificationsCommentModerated.contains(notification) else {
163163
return

0 commit comments

Comments
 (0)