美文网首页
Alamofire源码解析 - Notifications

Alamofire源码解析 - Notifications

作者: wanglj | 来源:发表于2017-03-27 15:52 被阅读0次
    extension Notification.Name {
        /// Used as a namespace for all `URLSessionTask` related notifications.
        public struct Task {
            /// Posted when a `URLSessionTask` is resumed. The notification `object` contains the resumed `URLSessionTask`.
            public static let DidResume = Notification.Name(rawValue: "org.alamofire.notification.name.task.didResume")
    
            /// Posted when a `URLSessionTask` is suspended. The notification `object` contains the suspended `URLSessionTask`.
            public static let DidSuspend = Notification.Name(rawValue: "org.alamofire.notification.name.task.didSuspend")
    
            /// Posted when a `URLSessionTask` is cancelled. The notification `object` contains the cancelled `URLSessionTask`.
            public static let DidCancel = Notification.Name(rawValue: "org.alamofire.notification.name.task.didCancel")
    
            /// Posted when a `URLSessionTask` is completed. The notification `object` contains the completed `URLSessionTask`.
            public static let DidComplete = Notification.Name(rawValue: "org.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 = "org.alamofire.notification.key.task"
        }
    }
    
    

    相关文章

      网友评论

          本文标题:Alamofire源码解析 - Notifications

          本文链接:https://www.haomeiwen.com/subject/ojyrottx.html