Instance Method

removeRoom(_:completionHandler:)

Removes a room from the home.

Declaration

func removeRoom(_ room: HMRoom, completionHandler completion: @escaping (Error?) -> Void)

Parameters

room

The room to remove.

completion

The block executed after the request is processed.

error

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

Discussion

If the room is in a zone, this method also removes it from the zone. Any accessories in the removed room automatically move to roomForEntireHome().

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.