@@ -291,9 +291,9 @@ open class URLSessionTask : NSObject, NSCopying {
291
291
/// will be used.
292
292
///
293
293
/// If no priority is specified, the task will operate with the default priority
294
- /// as defined by the constant URLSessionTaskPriorityDefault . Two additional
295
- /// priority levels are provided: URLSessionTaskPriorityLow and
296
- /// URLSessionTaskPriorityHigh , but use is not restricted to these.
294
+ /// as defined by the constant URLSessionTask.defaultPriority . Two additional
295
+ /// priority levels are provided: URLSessionTask.lowPriority and
296
+ /// URLSessionTask.highPriority , but use is not restricted to these.
297
297
open var priority : Float {
298
298
get {
299
299
var r : Float = 0
@@ -304,7 +304,7 @@ open class URLSessionTask : NSObject, NSCopying {
304
304
taskAttributesIsolation. async ( flags: . barrier) { self . _priority = newValue }
305
305
}
306
306
}
307
- fileprivate var _priority : Float = URLSessionTaskPriorityDefault
307
+ fileprivate var _priority : Float = URLSessionTask . defaultPriority
308
308
}
309
309
310
310
extension URLSessionTask {
@@ -1116,9 +1116,19 @@ fileprivate extension HTTPURLResponse {
1116
1116
}
1117
1117
}
1118
1118
1119
- public let URLSessionTaskPriorityDefault : Float = 0.5
1120
- public let URLSessionTaskPriorityLow : Float = 0.25
1121
- public let URLSessionTaskPriorityHigh : Float = 0.75
1119
+ public extension URLSessionTask {
1120
+ /// The default URL session task priority, used implicitly for any task you
1121
+ /// have not prioritized. The floating point value of this constant is 0.5.
1122
+ public static let defaultPriority : Float = 0.5
1123
+
1124
+ /// A low URL session task priority, with a floating point value above the
1125
+ /// minimum of 0 and below the default value.
1126
+ public static let lowPriority : Float = 0.25
1127
+
1128
+ /// A high URL session task priority, with a floating point value above the
1129
+ /// default value and below the maximum of 1.0.
1130
+ public static let highPriority : Float = 0.75
1131
+ }
1122
1132
1123
1133
/*
1124
1134
* An URLSessionDataTask does not provide any additional
0 commit comments