---
title: "map(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/optional/publisher-swift.struct/map(_:)"
---

# map(_:)

## Declaration

```swift
func map<T>(_ transform: (Optional<Wrapped>.Publisher.Output) -> T) -> Optional<T>.Publisher
```
