Skip to content

Commit f87c885

Browse files
committed
Fix swift code
1 parent 417973b commit f87c885

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ios-example-app-swift/ios-example-app/ViewController.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ViewController: UIViewController, SessionExpirationDelegate {
3535
Pathshare.saveUserName("SDK User ios") { (error) -> Void in
3636
if error != nil {
3737
NSLog("User: Error")
38-
NSLog(error.description)
38+
NSLog(error!.localizedDescription)
3939
} else {
4040
NSLog("User: Success")
4141
self.createSession()
@@ -47,7 +47,7 @@ class ViewController: UIViewController, SessionExpirationDelegate {
4747
self.session.joinUser { (error) -> Void in
4848
if error != nil {
4949
NSLog("Session Join: Error")
50-
NSLog(error.description)
50+
NSLog(error!.localizedDescription)
5151
} else {
5252
NSLog("Session Join: Success")
5353
self.createButton?.isEnabled = false
@@ -61,7 +61,7 @@ class ViewController: UIViewController, SessionExpirationDelegate {
6161
self.session.leaveUser { (error) -> Void in
6262
if error != nil {
6363
NSLog("Session Leave: Error")
64-
NSLog(error.description)
64+
NSLog(error!.localizedDescription)
6565
} else {
6666
NSLog("Session Leave: Success")
6767
self.leaveButton?.isEnabled = false
@@ -85,18 +85,18 @@ class ViewController: UIViewController, SessionExpirationDelegate {
8585
self.session.trackingMode = PSTrackingMode.smart
8686
self.session.delegate = self
8787

88-
self.session.save { (error: NSError!) -> Void in
88+
self.session.save { (error) -> Void in
8989
if error != nil {
9090
NSLog("Session: Error")
91-
NSLog(error.description)
91+
NSLog(error!.localizedDescription)
9292
} else {
9393
NSLog("Session: Success")
9494
self.joinButton?.isEnabled = true
9595
self.createButton?.isEnabled = false
9696

9797
self.saveSessionIdentifier()
9898
}
99-
} as! (Error?) -> Void as! (Error?) -> Void as! (Error?) -> Void as! (Error?) -> Void as! (Error?) -> Void as! (Error?) -> Void as! (Error?) -> Void
99+
}
100100
}
101101

102102
fileprivate func findSession() {

0 commit comments

Comments
 (0)