Building view controllers with HomeKit

Let's now get started with our controllers with the help of HomeKit. Basically, we will need a view controller for each accessory. In this app, the garage has only one accessory, therefore it has only one view controller. The living room has three accessories: the door, the fan, and the aquarium. As we have three accessories for the same room, we are going to use a page view controller to display the rest of the view controllers.

Bear in mind that the view controllers can be different. Information about a door that can be open or closed is not retrieved in the same manner as the aquarium temperature is received. However, every accessory has some common parts like the device name, the service, and the characteristic. ...

Get Swift 2 Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.