---
title: "flatMap(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/dictionary/flatmap(_:)-6chv9"
---

# flatMap(_:)

## Declaration

```swift
func flatMap<ElementOfResult>(_ transform: (Self.Element) throws -> ElementOfResult?) rethrows -> [ElementOfResult]
```

## See Also

### Transforming a Dictionary

- [mapValues(_:)](swift/dictionary/mapvalues(_:).md)
- [reduce(_:_:)](swift/dictionary/reduce(_:_:).md)
- [reduce(into:_:)](swift/dictionary/reduce(into:_:).md)
- [compactMap(_:)](swift/dictionary/compactmap(_:).md)
- [compactMapValues(_:)](swift/dictionary/compactmapvalues(_:).md)
- [flatMap(_:)](swift/dictionary/flatmap(_:)-i3ly.md)
- [sorted(by:)](swift/dictionary/sorted(by:).md)
- [shuffled()](swift/dictionary/shuffled().md)
- [shuffled(using:)](swift/dictionary/shuffled(using:).md)
