[Solved] Variable keeps returning nil – Swift iOS
All your suggestions were valid but this is what actually worked. import Foundation import Alamofire class GreetingObjectHandler { var greetings: [Greeting] = [] init(filename: String) { let fileP = NSURL(string: “http://localhost:2403/users/me”) let jsonD = NSData(contentsOfURL:fileP!) let jso = JSON(data: jsonD!, options: NSJSONReadingOptions.AllowFragments, error: nil) var id = jso[“id”] let filePath = NSURL(string: “http://localhost:2403/users”) let jsonData … Read more