<!--
{
  "availability" : [
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AccessoryAccess",
  "identifier" : "/documentation/AccessoryAccess/AAUSBAccessoryMatchingCriteria/init(deviceMatchingCriteria:interfaceMatchingCriteria:interfaceMatchingOption:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Accessory Access",
      "AccessoryAccess"
    ],
    "preciseIdentifier" : "s:So30AAUSBAccessoryMatchingCriteriaC15AccessoryAccessE06devicebC009interfacebC00gB6OptionA2bCE06DevicebC0VSg_SayAbCE09InterfacebC0VGSo0abcjbH0Vtcfc"
  },
  "title" : "init(deviceMatchingCriteria:interfaceMatchingCriteria:interfaceMatchingOption:)"
}
-->

# init(deviceMatchingCriteria:interfaceMatchingCriteria:interfaceMatchingOption:)

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

```
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 [`AAUSBAccessoryMatchingCriteria.InterfaceMatchingOption.matchAll`](/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

Initialize a criteria object using USB interface matching dictionaries, for the given USB device matching dictionary.

Use <doc://com.apple.documentation/documentation/IOUSBHost/IOUSBHostDevice/createMatchingDictionaryWithVendorID:productID:bcdDevice:deviceClass:deviceSubclass:deviceProtocol:speed:productIDArray:> to create a USB device matching dictionary.

Use <doc://com.apple.documentation/documentation/IOUSBHost/IOUSBHostInterface/createMatchingDictionaryWithVendorID:productID:bcdDevice:interfaceNumber:configurationValue:interfaceClass:interfaceSubclass:interfaceProtocol:speed:productIDArray:> to create a USB interface matching dictionary.

See USBSpec.h in <doc://com.apple.documentation/documentation/iokit/usbspec_h_user-space> in <doc://com.apple.documentation/documentation/iokit> for more details about dictionary keys for the USB device/interface matching dictionaries.

If the criteria is initialized with [`AAUSBAccessoryMatchingCriteria.InterfaceMatchingOption.matchAny`](/documentation/AccessoryAccess/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.

---

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)