---
title: "init(deviceMatchingCriteria:interfaceMatchingCriteria:interfaceMatchingOption:)"
framework: accessoryaccess
role: symbol
role_heading: Initializer
path: "accessoryaccess/aausbaccessorymatchingcriteria/init(devicematchingcriteria:interfacematchingcriteria:interfacematchingoption:)"
---

# init(deviceMatchingCriteria:interfaceMatchingCriteria:interfaceMatchingOption:)

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

## Declaration

```swift
convenience init(deviceMatchingCriteria: AAUSBAccessoryMatchingCriteria.DeviceMatchingCriteria?, interfaceMatchingCriteria: [AAUSBAccessoryMatchingCriteria.InterfaceMatchingCriteria], interfaceMatchingOption: AAUSBAccessoryMatchingCriteria.InterfaceMatchingOption)
```

## Parameters

- `deviceMatchingCriteria`: USB device matching criteria.
- `interfaceMatchingCriteria`: USB interface matching criteria.
- `interfaceMatchingOption`: Option that specifies how the framework performs interface matching for a USB accessory. If the criteria is initialized with doc://com.apple.accessoryaccess/documentation/AccessoryAccess/AAUSBAccessoryMatchingCriteria/InterfaceMatchingOption/matchAll, then it evaluates to true for a USB accessory when It matches the given non-nil deviceMatchingDictionary, and For the currently set configuration, all the interfaceMatchingDictionaries match at least one of its USB interfaces.

## Discussion

Discussion Initialize a criteria object using USB interface matching dictionaries, for the given USB device matching dictionary. 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. If the criteria is initialized with AAUSBAccessoryMatchingCriteria.InterfaceMatchingOption.matchAny, then it evaluates to true for a USB accessory when it matches the given 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(deviceMatchingDictionary:interfaceMatchingDictionaries:interfaceMatchingOption:)](accessoryaccess/aausbaccessorymatchingcriteria/init(devicematchingdictionary:interfacematchingdictionaries:interfacematchingoption:).md)
- [init(deviceMatchingCriteria:)](accessoryaccess/aausbaccessorymatchingcriteria/init(devicematchingcriteria:).md)
