The manager for a collection of one or more of a user’s homes.


class HMHomeManager : NSObject


HomeKit stores the user’s home automation information in a database that’s shared among Apple’s built-in iOS Home app, your HomeKit-enabled app, and apps from other developers. All these apps access the database as peers using the HomeKit framework.

Diagram showing how different apps use HomeKit to access the shared HomeKit database.

Each app creates a single HMHomeManager instance to coordinate its HomeKit-related activities. The manager’s homes array gives your app access to a collection of HMHome instances that represent the user’s homes. These in turn contain references to the home automation accessories that your app can inspect and control.

Diagram showing a collection of homes within the home manager, each of which has a collection of accessories.

Adopt the HMHomeManagerDelegate protocol in your app to stay informed of any changes to the set of homes made outside your app.


Inspecting Authorization Status

var authorizationStatus: HMHomeManagerAuthorizationStatus

The current state of the app’s access to home data.

struct HMHomeManagerAuthorizationStatus

The possible home-access states.

Working with the Home Layout

var homes: [HMHome]

An array of all homes managed by this home manager.

class HMHome

The primary unit of living space, typically composed of rooms organized into zones.

Keeping Track of Connected Homes

var delegate: HMHomeManagerDelegate?

A delegate that receives updates on the collection of homes.

protocol HMHomeManagerDelegate

An interface the home manager uses to communicate changes to the state of the home network.

Adding and Removing Homes

Managing the Primary Home

var primaryHome: HMHome?

The primary home managed by this home manager.

func updatePrimaryHome(HMHome, completionHandler: (Error?) -> Void)

Updates the primary home of this home manager.


Inherits From

Conforms To

See Also

The Home Manager

Configuring a Home Automation Device

Give users a familiar experience when they manage HomeKit accessories.

Testing Your App with the HomeKit Accessory Simulator

Install the HomeKit Accessory Simulator to help you debug your HomeKit-enabled app.