<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "EventKit",
  "identifier" : "/documentation/EventKit/EKVirtualConferenceProvider/fetchAvailableRoomTypes(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "EventKit"
    ],
    "preciseIdentifier" : "c:objc(cs)EKVirtualConferenceProvider(im)fetchAvailableRoomTypesWithCompletionHandler:"
  },
  "title" : "fetchAvailableRoomTypes(completionHandler:)"
}
-->

# fetchAvailableRoomTypes(completionHandler:)

Provides an array of room types where events take place.

```
func fetchAvailableRoomTypes(completionHandler: @escaping @Sendable ([EKVirtualConferenceRoomTypeDescriptor]?, (any Error)?) -> Void)
```

```
func fetchAvailableRoomTypes() async throws -> [EKVirtualConferenceRoomTypeDescriptor]
```

## Parameters

`completionHandler`

A completion handler that you call after you determine the available rooms. If you provide an array with one or more room type descriptors, pass `nil` for the error parameter. Conversely, if you provide an error object, pass `nil` for the array parameter.

## Discussion

Your virtual conference provider implements this method to provide the list of rooms where users schedule events using your service. Create an instance of [`EKVirtualConferenceRoomTypeDescriptor`](/documentation/EventKit/EKVirtualConferenceRoomTypeDescriptor) for each room that’s available for users to schedule events in.

```swift
override func fetchAvailableRoomTypes(completionHandler: @escaping ([EKVirtualConferenceRoomTypeDescriptor]?, Error?) -> Void) {
    // Create two rooms, one for the user's personal room and a
    // second room for team events.
    let personalRoom = EKVirtualConferenceRoomTypeDescriptor(
        title: "Maria's Personal Room",
        identifier: "personal-room"
    )
    let teamRoom = EKVirtualConferenceRoomTypeDescriptor(
        title: "Team Room",
        identifier: "team-room"
    )

    // Call the completion handler with an array that contains
    // both rooms.
    let allRooms = [personalRoom, teamRoom]
    completionHandler(allRooms, nil)
}
```

If your virtual conference provider is unable to provide any room types, call the completion handler with `nil` for the array and an error that describes why rooms aren’t available.

Users choose one of the room type descriptors when adding an event to their calendar. To complete the process of adding the event, EventKit calls [`fetchVirtualConference(identifier:completionHandler:)`](/documentation/EventKit/EKVirtualConferenceProvider/fetchVirtualConference(identifier:completionHandler:)) and passes the room type descriptor that the user selects.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)