Instance Method

addRoom(withName:completionHandler:)

Creates a new room with the specified name.

Declaration

func addRoom(withName roomName: String, completionHandler completion: @escaping (HMRoom?, Error?) -> Void)

Parameters

roomName

The name of the new room. Must not be nil, and must not be the name of a room already in the home.

completion

The block executed after the request is processed.

room

The newly created room.

error

nil on success; otherwise, error object indicating the reason for failure.

See Also

Dividing a House into Rooms

var rooms: [HMRoom]

An array of the rooms in the home.

func roomForEntireHome() -> HMRoom

A room that represents all parts of the home that don’t have a more specific room to represent them.

class HMRoom

The smallest subdivision of a home’s space.