|
|
@@ -24,24 +24,29 @@
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
-/// Contains all the `NSNotification` names posted by Alamofire with descriptions of each notification's payload.
|
|
|
-public struct Notifications {
|
|
|
- /// Used as a namespace for all `NSURLSessionTask` related notifications.
|
|
|
+extension Notification.Name {
|
|
|
+ /// Used as a namespace for all `URLSessionTask` related notifications.
|
|
|
public struct Task {
|
|
|
- /// Notification posted when an `NSURLSessionTask` is resumed. The notification `object` contains the resumed
|
|
|
- /// `NSURLSessionTask`.
|
|
|
- public static let DidResume = "com.alamofire.notifications.task.didResume"
|
|
|
+ /// Posted when a `URLSessionTask` is resumed. The notification `object` contains the resumed `URLSessionTask`.
|
|
|
+ public static let DidResume = Notification.Name(rawValue: "com.alamofire.notification.name.task.didResume")
|
|
|
|
|
|
- /// Notification posted when an `NSURLSessionTask` is suspended. The notification `object` contains the
|
|
|
- /// suspended `NSURLSessionTask`.
|
|
|
- public static let DidSuspend = "com.alamofire.notifications.task.didSuspend"
|
|
|
+ /// Posted when a `URLSessionTask` is suspended. The notification `object` contains the suspended `URLSessionTask`.
|
|
|
+ public static let DidSuspend = Notification.Name(rawValue: "com.alamofire.notification.name.task.didSuspend")
|
|
|
|
|
|
- /// Notification posted when an `NSURLSessionTask` is cancelled. The notification `object` contains the
|
|
|
- /// cancelled `NSURLSessionTask`.
|
|
|
- public static let DidCancel = "com.alamofire.notifications.task.didCancel"
|
|
|
+ /// Posted when a `URLSessionTask` is cancelled. The notification `object` contains the cancelled `URLSessionTask`.
|
|
|
+ public static let DidCancel = Notification.Name(rawValue: "com.alamofire.notification.name.task.didCancel")
|
|
|
|
|
|
- /// Notification posted when an `NSURLSessionTask` is completed. The notification `object` contains the
|
|
|
- /// completed `NSURLSessionTask`.
|
|
|
- public static let DidComplete = "com.alamofire.notifications.task.didComplete"
|
|
|
+ /// Posted when a `URLSessionTask` is completed. The notification `object` contains the completed `URLSessionTask`.
|
|
|
+ public static let DidComplete = Notification.Name(rawValue: "com.alamofire.notification.name.task.didComplete")
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// MARK: -
|
|
|
+
|
|
|
+extension Notification {
|
|
|
+ /// Used as a namespace for all `Notification` user info dictionary keys.
|
|
|
+ public struct Key {
|
|
|
+ /// User info dictionary key representing the `URLSessionTask` associated with the notification.
|
|
|
+ public static let Task = "com.alamofire.notification.key.task"
|
|
|
}
|
|
|
}
|