Building Arduino Projects for the Internet of Things

(Steven Felgate) #1
CHAPTER 7 ■ IOT PATTERNS: ON-DEMAND CLIENTS

let jsonResponse: NSDictionary!=(try! NSJSONSerialization.
JSONObjectWithData(data!, options: NSJSONReadingOptions.MutableContainers))
as! NSDictionary


self.parkingSpots.text = "Open Parking Spots: " +
String(jsonResponse["PARKING_SPOTS_COUNT"]!)
}
}


override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}


override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}


}


Before your iOS app can make any Internet calls, you need to add a property in
Info.plist. As shown in Figure  7-32 , click on the + on the top-level parent Information
Property List.


Figure 7-32. Info.plist properties list

Free download pdf