---
title: "applied(to:eventHandler:)"
framework: createmlcomponents
role: symbol
role_heading: Instance Method
path: "createmlcomponents/optionalunwrapper/applied(to:eventhandler:)"
---

# applied(to:eventHandler:)

Unwraps an optional element or throws if the value is nil.

## Declaration

```swift
func applied(to input: Element?, eventHandler: EventHandler? = nil) throws -> Element
```

## Parameters

- `input`: The optional input.
- `eventHandler`: An event handler.

## Return Value

Return Value The unwrapped value.

## Discussion

Discussion note: MissingValueError if the input is nil.
