<!--
{
  "availability" : [
    "iOS: 18.2.0 -",
    "iPadOS: 18.2.0 -",
    "macCatalyst: 18.2.0 -",
    "macOS: 15.2.0 -",
    "tvOS: 18.2.0 -",
    "visionOS: 2.2.0 -",
    "watchOS: 11.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Matter",
  "identifier" : "/documentation/Matter/MTRDeviceType/init(forID:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Matter"
    ],
    "preciseIdentifier" : "c:objc(cs)MTRDeviceType(cm)deviceTypeForID:"
  },
  "title" : "init(forID:)"
}
-->

# init(forID:)

Returns an MTRDeviceType for the given ID, if the ID is known.  Returns nil
for unknown IDs.

```
init?(forID deviceTypeID: NSNumber)
```

---

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)