Skip to content

Commit 9f7b064

Browse files
author
nghialv
committed
resolve warnings from 1.2
1 parent 3f6a70b commit 9f7b064

File tree

3 files changed

+8
-19
lines changed

3 files changed

+8
-19
lines changed

Net/Net.swift

+5-6
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,13 @@ class Net : NSObject, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate, NS
208208
}
209209

210210
// MARK: NSURLSessionDelegate
211-
func URLSessionDidFinishEventsForBackgroundURLSession(session: NSURLSession!) {
211+
func URLSessionDidFinishEventsForBackgroundURLSession(session: NSURLSession) {
212212
// this will be call for every backgroud event
213213
eventsForBackgroundHandler?(session)
214214
}
215215

216216
// MARK: NSURLSessionTaskDelegate
217-
func URLSession(session: NSURLSession!, task: NSURLSessionTask!, didCompleteWithError error: NSError!) {
217+
func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError error: NSError?) {
218218
if (error != nil) {
219219
if let downloadTask = task as? NSURLSessionDownloadTask {
220220
let downloader = downloaders[downloadTask]
@@ -236,7 +236,7 @@ class Net : NSObject, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate, NS
236236
}
237237
}
238238

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) {
240240
// upload progress
241241
if let uploadTask = task as? NSURLSessionUploadTask {
242242
let progress = Double(totalBytesSent) / Double(totalBytesExpectedToSend)
@@ -246,13 +246,12 @@ class Net : NSObject, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate, NS
246246
}
247247
}
248248

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) {
251250
}
252251

253252

254253
// 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) {
256255
let progress = totalBytesExpectedToWrite == NSURLSessionTransferSizeUnknown ? -1.0 : Double(totalBytesWritten) / Double(totalBytesExpectedToWrite)
257256

258257
let downloader = downloaders[downloadTask]

ios_example/example/AppDelegate.swift

+1-11
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2323
NSLog("handle event for background session")
2424
}
2525

26-
func applicationDidEnterBackground(application: UIApplication!) {
26+
func applicationDidEnterBackground(application: UIApplication) {
2727
NSLog("App did enter background")
2828
}
29-
30-
func applicationWillEnterForeground(application: UIApplication!) {
31-
}
32-
33-
func applicationDidBecomeActive(application: UIApplication!) {
34-
}
35-
36-
func applicationWillTerminate(application: UIApplication!) {
37-
}
38-
3929
}
4030

ios_example/example/HttpViewController.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ class HttpViewController: UIViewController, NSXMLParserDelegate {
1919
}
2020

2121
// MARK: NSXMLParser delegate
22-
func parser(parser: NSXMLParser!, didStartElement elementName: String!, namespaceURI: String!, qualifiedName qName: String!, attributes attributeDict: [NSObject : AnyObject]!) {
22+
func parser(parser: NSXMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [NSObject : AnyObject]) {
2323
NSLog("did start element : \(elementName)")
2424
}
2525

26-
func parser(parser: NSXMLParser!, foundCharacters string: String!) {
26+
func parser(parser: NSXMLParser, foundCharacters string: String?) {
2727
}
2828

2929
// MARK: Actions

0 commit comments

Comments
 (0)