<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/Escapable",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s9EscapableP"
  },
  "title" : "Escapable"
}
-->

# Escapable

A type whose values can persist beyond their immediate local scope.

```
protocol Escapable
```

## Overview

Escapable values can be assigned to global or static variables, returned from functions, captured by escaping
closures, and so on. All Swift types implicitly conform to this protocol by default, allowing them to be moved across
scopes freely because they lack any lifetime dependencies.

In contrast, values of types that suppress their implicit conformance to `Escapable` (by writing `~Escapable`)
carry a lifetime dependency. These dependencies ensure the `~Escapable` value does not live longer than the value it
depends on. Explicit lifetime dependency annotations may be required when working with these types.

In generic contexts, `~Escapable` works much in the same way as `~Copyable`. It allows functions and types to work
with values that may or may not be Escapable, and types can be conditionally `Escapable` based on their generic
arguments. A conformance requirement for `Escapable` is automatically inferred in extensions and for generic type
parameters, unless suppressed with `~Escapable`.

## Relationships

### Conforming Types

[`OpaquePointer`](/documentation/Swift/OpaquePointer)

[`Lookahead`](/documentation/RegexBuilder/Lookahead)

[`LazyDropWhileSequence`](/documentation/Swift/LazyDropWhileSequence)

[`AnyRegexOutput`](/documentation/Swift/AnyRegexOutput)

[`Float80`](/documentation/Swift/Float80)

[`ArraySlice`](/documentation/Swift/ArraySlice)

[`ReverseParser`](/documentation/Swift/Unicode/UTF16/ReverseParser)

[`Iterator`](/documentation/Swift/DropWhileSequence/Iterator)

[`String`](/documentation/Swift/String)

[`Iterator`](/documentation/Swift/LazyFilterSequence/Iterator)

[`ValidationError`](/documentation/Swift/Unicode/UTF8/ValidationError)

[`UInt64`](/documentation/Swift/UInt64)

[`Attributed-swift.struct`](/documentation/Swift/Duration/TimeFormatStyle/Attributed-swift.struct)

[`SIMD64`](/documentation/Swift/SIMD64)

[`Words-swift.struct`](/documentation/Swift/UInt128/Words-swift.struct)

[`AsyncThrowingDropWhileSequence`](/documentation/Swift/AsyncThrowingDropWhileSequence)

[`AsyncFlatMapSequence`](/documentation/Swift/AsyncFlatMapSequence)

[`EncodingError`](/documentation/Swift/EncodingError)

[`ObservationRegistrar`](/documentation/Observation/ObservationRegistrar)

[`Iterator`](/documentation/Swift/PartialRangeFrom/Iterator)

[`Iterator`](/documentation/Swift/FlattenSequence/Iterator)

[`UTF16View`](/documentation/Swift/Unicode/Scalar/UTF16View)

[`DefaultStringInterpolation`](/documentation/Swift/DefaultStringInterpolation)

[`StaticBigInt`](/documentation/Swift/StaticBigInt)

[`UTF16View`](/documentation/Swift/Substring/UTF16View)

[`Keys-swift.struct`](/documentation/Swift/Dictionary/Keys-swift.struct)

[`AsyncFilterSequence`](/documentation/Swift/AsyncFilterSequence)

[`TimeFormatStyle`](/documentation/Swift/Duration/TimeFormatStyle)

[`PartialRangeFrom`](/documentation/Swift/PartialRangeFrom)

[`FloatingPointSign`](/documentation/Swift/FloatingPointSign)

[`Anchor`](/documentation/RegexBuilder/Anchor)

[`NegativeLookahead`](/documentation/RegexBuilder/NegativeLookahead)

[`UTF8View`](/documentation/Swift/String/UTF8View)

[`Duration`](/documentation/Swift/Duration)

[`AnyBidirectionalCollection`](/documentation/Swift/AnyBidirectionalCollection)

[`UnitsFormatStyle`](/documentation/Swift/Duration/UnitsFormatStyle)

[`Scalar`](/documentation/Swift/Unicode/Scalar)

[`Iterator`](/documentation/Swift/UnsafeRawBufferPointer/Iterator)

[`Ranges-swift.struct`](/documentation/Swift/RangeSet/Ranges-swift.struct)

[`Iterator`](/documentation/Swift/EnumeratedSequence/Iterator)

[`UnownedJob`](/documentation/Swift/UnownedJob)

[`AnyIterator`](/documentation/Swift/AnyIterator)

[`AsyncMapSequence`](/documentation/Swift/AsyncMapSequence)

[`SIMD2`](/documentation/Swift/SIMD2)

[`UnicodeScalarView`](/documentation/Swift/String/UnicodeScalarView)

[`Int`](/documentation/Swift/Int)

[`Result`](/documentation/Swift/Result)

[`UTF8`](/documentation/Swift/Unicode/UTF8)

[`ZeroOrMore`](/documentation/RegexBuilder/ZeroOrMore)

[`Iterator`](/documentation/Swift/ReversedCollection/Iterator)

[`UnsafeMutableBufferPointer`](/documentation/Swift/UnsafeMutableBufferPointer)

[`Repeated`](/documentation/Swift/Repeated)

[`OneOrMore`](/documentation/RegexBuilder/OneOrMore)

[`Substring`](/documentation/Swift/Substring)

[`ContinuousClock`](/documentation/Swift/ContinuousClock)

[`UTF32`](/documentation/Swift/Unicode/UTF32)

[`Float16`](/documentation/Swift/Float16)

[`ReverseParser`](/documentation/Swift/Unicode/UTF8/ReverseParser)

[`StrideThroughIterator`](/documentation/Swift/StrideThroughIterator)

[`Double`](/documentation/Swift/Double)

[`PartialRangeThrough`](/documentation/Swift/PartialRangeThrough)

[`Encoding`](/documentation/Swift/String/Encoding)

[`CharacterClass`](/documentation/RegexBuilder/CharacterClass)

[`AsyncPrefixWhileSequence`](/documentation/Swift/AsyncPrefixWhileSequence)

[`AsyncStream`](/documentation/Swift/AsyncStream)

[`UInt128`](/documentation/Swift/UInt128)

[`SuspendingClock`](/documentation/Swift/SuspendingClock)

[`AsyncThrowingFlatMapSequence`](/documentation/Swift/AsyncThrowingFlatMapSequence)

[`AnyRandomAccessCollection`](/documentation/Swift/AnyRandomAccessCollection)

[`AsyncThrowingCompactMapSequence`](/documentation/Swift/AsyncThrowingCompactMapSequence)

[`EmptyCollection`](/documentation/Swift/EmptyCollection)

[`Iterator`](/documentation/Swift/LazyMapSequence/Iterator)

[`Values-swift.struct`](/documentation/Swift/Dictionary/Values-swift.struct)

[`UInt8`](/documentation/Swift/UInt8)

[`Dictionary`](/documentation/Swift/Dictionary)

[`UnsafeRawBufferPointer`](/documentation/Swift/UnsafeRawBufferPointer)

[`Iterator`](/documentation/Swift/Set/Iterator)

[`Int16`](/documentation/Swift/Int16)

[`Iterator`](/documentation/Swift/EmptyCollection/Iterator)

[`Slice`](/documentation/Swift/Slice)

[`KeyValuePairs`](/documentation/Swift/KeyValuePairs)

[`LazyFilterSequence`](/documentation/Swift/LazyFilterSequence)

[`IndexingIterator`](/documentation/Swift/IndexingIterator)

[`RangeSet`](/documentation/Swift/RangeSet)

[`Float`](/documentation/Swift/Float)

[`Iterator`](/documentation/Swift/PrefixSequence/Iterator)

[`Mirror`](/documentation/Swift/Mirror)

[`AtomicStoreOrdering`](/documentation/Synchronization/AtomicStoreOrdering)

[`PrefixSequence`](/documentation/Swift/PrefixSequence)

[`TryCapture`](/documentation/RegexBuilder/TryCapture)

[`JoinedSequence`](/documentation/Swift/JoinedSequence)

[`SIMD32`](/documentation/Swift/SIMD32)

[`AnyKeyPath`](/documentation/Swift/AnyKeyPath)

[`ReversedCollection`](/documentation/Swift/ReversedCollection)

[`WordPair`](/documentation/Synchronization/WordPair)

[`ThrowingTaskGroup`](/documentation/Swift/ThrowingTaskGroup)

[`Optionally`](/documentation/RegexBuilder/Optionally)

[`AsyncThrowingStream`](/documentation/Swift/AsyncThrowingStream)

[`CollectionOfOne`](/documentation/Swift/CollectionOfOne)

[`AsyncThrowingPrefixWhileSequence`](/documentation/Swift/AsyncThrowingPrefixWhileSequence)

[`ASCII`](/documentation/Swift/Unicode/ASCII)

[`FlattenSequence`](/documentation/Swift/FlattenSequence)

[`Local`](/documentation/RegexBuilder/Local)

[`Iterator`](/documentation/Swift/Dictionary/Iterator)

[`LocalizationValue`](/documentation/Swift/String/LocalizationValue)

[`AsyncCompactMapSequence`](/documentation/Swift/AsyncCompactMapSequence)

[`ClosedRange`](/documentation/Swift/ClosedRange)

[`Iterator`](/documentation/Swift/CollectionOfOne/Iterator)

[`Instant`](/documentation/Swift/SuspendingClock/Instant)

[`UnicodeScalarView`](/documentation/Swift/Substring/UnicodeScalarView)

[`Bool`](/documentation/Swift/Bool)

[`SIMD16`](/documentation/Swift/SIMD16)

[`DefaultIndices`](/documentation/Swift/DefaultIndices)

[`Iterator`](/documentation/Swift/Zip2Sequence/Iterator)

[`Never`](/documentation/Swift/Never)

[`AsyncThrowingFilterSequence`](/documentation/Swift/AsyncThrowingFilterSequence)

[`SIMD8`](/documentation/Swift/SIMD8)

[`Index`](/documentation/Swift/String/Index)

[`UnsafeMutableRawPointer`](/documentation/Swift/UnsafeMutableRawPointer)

[`PartialRangeUpTo`](/documentation/Swift/PartialRangeUpTo)

[`AsyncDropWhileSequence`](/documentation/Swift/AsyncDropWhileSequence)

[`Array`](/documentation/Swift/Array)

[`StaticString`](/documentation/Swift/StaticString)

[`Attributed-swift.struct`](/documentation/Swift/Duration/UnitsFormatStyle/Attributed-swift.struct)

[`Set`](/documentation/Swift/Set)

[`EnumeratedSequence`](/documentation/Swift/EnumeratedSequence)

[`AsyncPrefixSequence`](/documentation/Swift/AsyncPrefixSequence)

[`UnsafeMutableRawBufferPointer`](/documentation/Swift/UnsafeMutableRawBufferPointer)

[`StrideTo`](/documentation/Swift/StrideTo)

[`ContiguousArray`](/documentation/Swift/ContiguousArray)

[`Instant`](/documentation/Swift/ContinuousClock/Instant)

[`Kind-swift.struct`](/documentation/Swift/Unicode/UTF8/ValidationError/Kind-swift.struct)

[`SIMD3`](/documentation/Swift/SIMD3)

[`UTF16View`](/documentation/Swift/String/UTF16View)

[`Capture`](/documentation/RegexBuilder/Capture)

[`Int8`](/documentation/Swift/Int8)

[`AnySequence`](/documentation/Swift/AnySequence)

[`ForwardParser`](/documentation/Swift/Unicode/UTF16/ForwardParser)

[`SIMD4`](/documentation/Swift/SIMD4)

[`DecodingError`](/documentation/Swift/DecodingError)

[`AtomicLoadOrdering`](/documentation/Synchronization/AtomicLoadOrdering)

[`Parser`](/documentation/Swift/Unicode/UTF32/Parser)

[`Optional`](/documentation/Swift/Optional)

[`CVaListPointer`](/documentation/Swift/CVaListPointer)

[`UInt32`](/documentation/Swift/UInt32)

[`LazyPrefixWhileSequence`](/documentation/Swift/LazyPrefixWhileSequence)

[`UInt16`](/documentation/Swift/UInt16)

[`Repeat`](/documentation/RegexBuilder/Repeat)

[`Int64`](/documentation/Swift/Int64)

[`DropFirstSequence`](/documentation/Swift/DropFirstSequence)

[`LazySequence`](/documentation/Swift/LazySequence)

[`StrideThrough`](/documentation/Swift/StrideThrough)

[`Unmanaged`](/documentation/Swift/Unmanaged)

[`Character`](/documentation/Swift/Character)

[`ForwardParser`](/documentation/Swift/Unicode/UTF8/ForwardParser)

[`Zip2Sequence`](/documentation/Swift/Zip2Sequence)

[`Change`](/documentation/Swift/CollectionDifference/Change)

[`ChoiceOf`](/documentation/RegexBuilder/ChoiceOf)

[`Iterator`](/documentation/Swift/JoinedSequence/Iterator)

[`LazyMapSequence`](/documentation/Swift/LazyMapSequence)

[`Index`](/documentation/Swift/DiscontiguousSlice/Index)

[`Int32`](/documentation/Swift/Int32)

[`Parser`](/documentation/Swift/Unicode/ASCII/Parser)

[`TaskPriority`](/documentation/Swift/TaskPriority)

[`UnsafeRawPointer`](/documentation/Swift/UnsafeRawPointer)

[`UTF8View`](/documentation/Swift/Unicode/Scalar/UTF8View)

[`Iterator`](/documentation/Swift/LazyDropWhileSequence/Iterator)

[`DropWhileSequence`](/documentation/Swift/DropWhileSequence)

[`AsyncThrowingMapSequence`](/documentation/Swift/AsyncThrowingMapSequence)

[`InlineArray`](/documentation/Swift/InlineArray)

[`Int128`](/documentation/Swift/Int128)

[`DiscontiguousSlice`](/documentation/Swift/DiscontiguousSlice)

[`ObjectIdentifier`](/documentation/Swift/ObjectIdentifier)

[`Iterator`](/documentation/Swift/UnsafeBufferPointer/Iterator)

[`UInt`](/documentation/Swift/UInt)

[`Options`](/documentation/Observation/ObservationTracking/Options)

[`UTF8View`](/documentation/Swift/Substring/UTF8View)

[`UnsafeBufferPointer`](/documentation/Swift/UnsafeBufferPointer)

[`AtomicUpdateOrdering`](/documentation/Synchronization/AtomicUpdateOrdering)

[`TaskGroup`](/documentation/Swift/TaskGroup)

[`StrideToIterator`](/documentation/Swift/StrideToIterator)

[`IteratorSequence`](/documentation/Swift/IteratorSequence)

[`UnsafePointer`](/documentation/Swift/UnsafePointer)

[`UnsafeMutablePointer`](/documentation/Swift/UnsafeMutablePointer)

[`Range`](/documentation/Swift/Range)

[`AsyncDropFirstSequence`](/documentation/Swift/AsyncDropFirstSequence)

[`AnyCollection`](/documentation/Swift/AnyCollection)

[`UTF16`](/documentation/Swift/Unicode/UTF16)

[`Iterator`](/documentation/Swift/LazyPrefixWhileSequence/Iterator)

[`CollectionDifference`](/documentation/Swift/CollectionDifference)

[`AutoreleasingUnsafeMutablePointer`](/documentation/Swift/AutoreleasingUnsafeMutablePointer)

[`AnyHashable`](/documentation/Swift/AnyHashable)

---

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)