Contents

addRoom(withName:completionHandler:)

Creates a new room with the specified name.

Declaration

func addRoom(withName roomName: String, completionHandler completion: @escaping  @Sendable (HMRoom?, (any Error)?) -> Void)
func addRoom(named roomName: String) async throws -> HMRoom

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