---
title: "init(deviceMatchingDictionary:interfaceMatchingDictionaries:interfaceMatchingOption:)"
framework: accessoryaccess
role: symbol
role_heading: Initializer
path: "accessoryaccess/aausbaccessorymatchingcriteria/init(devicematchingdictionary:interfacematchingdictionaries:interfacematchingoption:)"
---

# init(deviceMatchingDictionary:interfaceMatchingDictionaries:interfaceMatchingOption:)

Initializes a criteria object using USB interface matching dictionaries, for the provided USB device matching criteria.

## Declaration

```swift
init?(deviceMatchingDictionary: [String : any Sendable]?, interfaceMatchingDictionaries: [[String : any Sendable]], interfaceMatchingOption: AAUSBAccessoryMatchingCriteria.InterfaceMatchingOption)
```

## Parameters

- `deviceMatchingDictionary`: USB device matching dictionary.
- `interfaceMatchingDictionaries`: USB interface matching criteria.
- `interfaceMatchingOption`: Option specifying how the framework performs interface matching for a USB accessory. For more information on interface matching options, see doc://com.apple.accessoryaccess/documentation/AccessoryAccess/AAUSBAccessoryMatchingCriteria/init(deviceMatchingDictionary:interfaceMatchingDictionaries:interfaceMatchingOption:)#Understanding-interface-matching-options.

## Discussion

Discussion Use createMatchingDictionaryWithVendorID:productID:bcdDevice:deviceClass:deviceSubclass:deviceProtocol:speed:productIDArray: to create a USB device matching dictionary. Use createMatchingDictionaryWithVendorID:productID:bcdDevice:interfaceNumber:configurationValue:interfaceClass:interfaceSubclass:interfaceProtocol:speed:productIDArray: to create a USB interface matching dictionary. See USBSpec.h in USBSpec.h User-Space in IOKit for more details about dictionary keys for the USB device/interface matching dictionaries. Understanding interface matching options If you initialize the criteria with AAUSBAccessoryMatchingCriteria.InterfaceMatchingOption.matchAll, then it evaluates to true for a USB accessory when It matches the provided non-nil deviceMatchingDictionary, and For the currently set configuration, all the interfaceMatchingDictionaries match at least one of its USB interfaces. If you initialize the criteria is with AAUSBAccessoryMatchingCriteria.InterfaceMatchingOption.matchAny, then it evaluates to true for a USB accessory when It matches the provided non-nil deviceMatchingDictionary, and For the currently set configuration, any of the interfaceMatchingDictionaries match at least one of its USB interfaces.

## See Also

### Creating matching criteria

- [init(deviceMatchingDictionary:)](accessoryaccess/aausbaccessorymatchingcriteria/init(devicematchingdictionary:).md)
- [init(deviceMatchingCriteria:)](accessoryaccess/aausbaccessorymatchingcriteria/init(devicematchingcriteria:).md)
- [init(deviceMatchingCriteria:interfaceMatchingCriteria:interfaceMatchingOption:)](accessoryaccess/aausbaccessorymatchingcriteria/init(devicematchingcriteria:interfacematchingcriteria:interfacematchingoption:).md)
