Skip to content

Commit f3e171c

Browse files
author
Clément Le Provost
committed
Type notifications as Notification.Name
1 parent 6abec7f commit f3e171c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Source/Offline/MirroredIndex.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ import Foundation
8383
// MARK: Constants
8484

8585
/// Notification sent when the sync has started.
86-
@objc public static let SyncDidStartNotification = "AlgoliaSearch.MirroredIndex.SyncDidStartNotification"
86+
@objc public static let SyncDidStartNotification = Notification.Name("AlgoliaSearch.MirroredIndex.SyncDidStartNotification")
8787

8888
/// Notification sent when the sync has finished.
89-
@objc public static let SyncDidFinishNotification = "AlgoliaSearch.MirroredIndex.SyncDidFinishNotification"
89+
@objc public static let SyncDidFinishNotification = Notification.Name("AlgoliaSearch.MirroredIndex.SyncDidFinishNotification")
9090

9191
/// Notification user info key used to pass the error, when an error occurred during the sync.
9292
@objc public static let SyncErrorKey = "AlgoliaSearch.MirroredIndex.SyncErrorKey"
@@ -300,7 +300,7 @@ import Foundation
300300

301301
// Notify observers.
302302
DispatchQueue.main.async {
303-
NotificationCenter.default.post(name: Notification.Name(rawValue: MirroredIndex.SyncDidStartNotification), object: self)
303+
NotificationCenter.default.post(name: MirroredIndex.SyncDidStartNotification, object: self)
304304
}
305305

306306
// Create temporary directory.
@@ -434,7 +434,7 @@ import Foundation
434434
if self.syncError != nil {
435435
userInfo = [MirroredIndex.SyncErrorKey: self.syncError!]
436436
}
437-
NotificationCenter.default.post(name: Notification.Name(rawValue: MirroredIndex.SyncDidFinishNotification), object: self, userInfo: userInfo)
437+
NotificationCenter.default.post(name: MirroredIndex.SyncDidFinishNotification, object: self, userInfo: userInfo)
438438
}
439439
}
440440

0 commit comments

Comments
 (0)