@@ -208,13 +208,13 @@ class Net : NSObject, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate, NS
208
208
}
209
209
210
210
// MARK: NSURLSessionDelegate
211
- func URLSessionDidFinishEventsForBackgroundURLSession( session: NSURLSession ! ) {
211
+ func URLSessionDidFinishEventsForBackgroundURLSession( session: NSURLSession ) {
212
212
// this will be call for every backgroud event
213
213
eventsForBackgroundHandler ? ( session)
214
214
}
215
215
216
216
// MARK: NSURLSessionTaskDelegate
217
- func URLSession( session: NSURLSession ! , task: NSURLSessionTask ! , didCompleteWithError error: NSError ! ) {
217
+ func URLSession( session: NSURLSession , task: NSURLSessionTask , didCompleteWithError error: NSError ? ) {
218
218
if ( error != nil ) {
219
219
if let downloadTask = task as? NSURLSessionDownloadTask {
220
220
let downloader = downloaders [ downloadTask]
@@ -236,7 +236,7 @@ class Net : NSObject, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate, NS
236
236
}
237
237
}
238
238
239
- func URLSession( session: NSURLSession ! , task: NSURLSessionTask ! , didSendBodyData bytesSent: Int64 , totalBytesSent: Int64 , totalBytesExpectedToSend: Int64 ) {
239
+ func URLSession( session: NSURLSession , task: NSURLSessionTask , didSendBodyData bytesSent: Int64 , totalBytesSent: Int64 , totalBytesExpectedToSend: Int64 ) {
240
240
// upload progress
241
241
if let uploadTask = task as? NSURLSessionUploadTask {
242
242
let progress = Double ( totalBytesSent) / Double( totalBytesExpectedToSend)
@@ -246,13 +246,12 @@ class Net : NSObject, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate, NS
246
246
}
247
247
}
248
248
249
- func URLSession( session: NSURLSession ! , task: NSURLSessionTask ! , willPerformHTTPRedirection response: NSHTTPURLResponse ! , newRequest request: NSURLRequest ! , completionHandler: ( ( NSURLRequest ! ) -> Void ) ! ) {
250
-
249
+ func URLSession( session: NSURLSession , task: NSURLSessionTask , willPerformHTTPRedirection response: NSHTTPURLResponse , newRequest request: NSURLRequest , completionHandler: ( NSURLRequest ! ) -> Void ) {
251
250
}
252
251
253
252
254
253
// MARK: NSURLSessionDownloadDelegate
255
- func URLSession( session: NSURLSession ! , downloadTask: NSURLSessionDownloadTask ! , didWriteData bytesWritten: Int64 , totalBytesWritten: Int64 , totalBytesExpectedToWrite: Int64 ) {
254
+ func URLSession( session: NSURLSession , downloadTask: NSURLSessionDownloadTask , didWriteData bytesWritten: Int64 , totalBytesWritten: Int64 , totalBytesExpectedToWrite: Int64 ) {
256
255
let progress = totalBytesExpectedToWrite == NSURLSessionTransferSizeUnknown ? - 1.0 : Double ( totalBytesWritten) / Double( totalBytesExpectedToWrite)
257
256
258
257
let downloader = downloaders [ downloadTask]
0 commit comments