<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaDevice",
  "identifier" : "/documentation/MediaDevice/MediaOutputDevice/AuthorizationMethod/numericCode(length:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Media Device"
    ],
    "preciseIdentifier" : "s:11MediaDevice0a6OutputB0V19AuthorizationMethodV11numericCode6lengthA2E0G6LengthV_tFZ"
  },
  "title" : "numericCode(length:)"
}
-->

# numericCode(length:)

Creates a numeric PIN entry authorization method.

```
static func numericCode(length: MediaOutputDevice.AuthorizationMethod.CodeLength) -> MediaOutputDevice.AuthorizationMethod
```

## Parameters

`length`

The number of digit fields presented in the pairing UI.

## Discussion

The system presents a UI with individual digit fields for the user to enter
a numeric code when connecting to the device.

```swift
// Present a 4-digit PIN entry UI
let auth = AuthorizationMethod.numericCode(length: .fourCharacter)
```

---

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)