Summary

In this chapter, you learned how to use the HomeKit framework. This framework is supposed to be used with third-party physical devices, but Apple provides a simulator called the HomeKit Accessory Simulator.

We set some devices as well as created some services and received their security code. Once we had our virtual devices, we set a virtual home with virtual rooms and added home devices to them.

HomeKit works with asynchronous calls as they are done via Bluetooth. This is the reason why we had to switch threads while using the UI, check for errors, and also request for the current accessory value.

In the next chapter, you will learn how to control your health with HealthKit.

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.