FBGraphUser in Swift
Asked Answered
G

0

7

I'm using the Facebook iOS SDK in Swift to access Facebook and I would like to work with the FBGraphUser (or FBGraphPlace, FBGraphLocation) protocols rather than with a pure Dictionary. The request completes successfully but I cannot cast the result to the FBProtocol

FBRequestConnection.startForMeWithCompletionHandler { (connection: FBRequestConnection!, result: AnyObject!, error: NSError!) -> Void in
     // this does not work
    if let fbGraphUser = result as? FBGraphUser {
        NSLog("\(fbGraphUser)")
    }

     // this works
    if let fbGraphUserDict = result as? Dictionary<String, AnyObject>{
        println("\(fbGraphUserDict)")
    }
}

How am I supposed to unwrap the optionals to get the FBxxxx objects ?

cheers

Gaiser answered 1/9, 2014 at 19:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.