Protocol

HMHomeManagerDelegate

A set of methods that helps a home manager object communicate changes to its delegate.

Overview

Implement this protocol and set your object as the delegate of a HMHomeManager object if you want to track changes to a collection of homes.

HomeKit invokes delegate methods to notify your app of changes to the state of the home network. In general, if your app invokes a HomeKit method with a completion handler parameter and the method is successful, the associated delegate message is sent to other HomeKit apps running on the same or remote iOS devices. If your app initiates the change, the delegate message is not sent to your app, so you should add code to both the completion handler and the associated delegate method to reload data and update views as needed. To learn more about how HomeKit uses the delegation design pattern, read About HomeKit Delegation Methods.

Topics

Monitoring Home Manager State Changes

func homeManager(HMHomeManager, didAdd: HMHome)

Tells the delegate that the home manager added a home.

func homeManager(HMHomeManager, didRemove: HMHome)

Tells the delegate that the home manager removed a home.

func homeManagerDidUpdateHomes(HMHomeManager)

Tells the delegate that the home manager updated its collection of homes.

func homeManagerDidUpdatePrimaryHome(HMHomeManager)

Tells the delegate that the home manager updated its primary home.

Relationships

Inherits From

See Also

Setting and Getting the Delegate

var delegate: HMHomeManagerDelegate?

Delegate that receives updates on the collection of homes.