---
title: "numericCode(length:)"
framework: mediadevice
role: symbol
role_heading: Type Method
path: "mediadevice/mediaoutputdevice/authorizationmethod/numericcode(length:)"
---

# numericCode(length:)

Creates a numeric PIN entry authorization method.

## Declaration

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

## Parameters

- `length`: The number of digit fields presented in the pairing UI.

## Mentioned in

Creating a media device extension

## Discussion

Discussion The system presents a UI with individual digit fields for the user to enter a numeric code when connecting to the device. // Present a 4-digit PIN entry UI let auth = AuthorizationMethod.numericCode(length: .fourCharacter)
