AnyCancellable
E427883
AnyCancellable is a type in Apple’s Combine framework that represents a token you can store and use to cancel an active subscription to a publisher.
All labels observed (1)
| Label | Occurrences |
|---|---|
| AnyCancellable canonical | 1 |
Statements (45)
| Predicate | Object |
|---|---|
| instanceOf |
Combine type
ⓘ
struct ⓘ type ⓘ |
| availability | requires Combine framework availability ⓘ |
| canBeStoredIn |
Array<AnyCancellable>
ⓘ
Set<AnyCancellable> ⓘ |
| cancelEffect |
releases resources associated with the subscription
ⓘ
terminates the underlying subscription ⓘ |
| canWrap | any Cancellable-conforming instance ⓘ |
| category | reactive programming utility ⓘ |
| conformsTo | Cancellable ⓘ |
| createdBy |
Publisher.assign(to:on:)
ⓘ
Publisher.handleEvents(receiveCancel:) ⓘ Publisher.sink(receiveCompletion:receiveValue:) ⓘ Publisher.sink(receiveValue:) ⓘ |
| definedIn | Combine framework NERFINISHED ⓘ |
| developedBy | Apple Inc. NERFINISHED ⓘ |
| documentationURL | https://developer.apple.com/documentation/combine/anycancellable ⓘ |
| hasMethod | cancel() ⓘ |
| introducedIn |
iOS 13
NERFINISHED
ⓘ
macOS 10.15 ⓘ tvOS 13 ⓘ watchOS 6 NERFINISHED ⓘ |
| languageFeature | uses Swift generics indirectly via publishers ⓘ |
| lifecycleBehavior | cancels subscription on deinit ⓘ |
| memoryManagement | uses ARC semantics ⓘ |
| moduleImport | import Combine ⓘ |
| ownershipModel |
subscription is active while AnyCancellable is retained
ⓘ
subscription is cancelled when AnyCancellable is deallocated ⓘ |
| pattern | used in store(in: &cancellables) pattern ⓘ |
| platform | Apple platforms NERFINISHED ⓘ |
| primaryOperation | cancel ⓘ |
| purpose |
acts as a token to cancel a subscription
ⓘ
represents a cancellable Combine subscription ⓘ |
| relatedTo |
Cancellable
ⓘ
Publisher ⓘ Subscriber ⓘ Subscription ⓘ |
| role | type eraser for Cancellable ⓘ |
| supports |
automatic cancellation on deallocation
ⓘ
manual cancellation ⓘ |
| threadSafety | not guaranteed thread-safe by default ⓘ |
| typicalUsage |
stored as a property to keep subscription alive
ⓘ
used to explicitly cancel a subscription ⓘ |
| usedIn | Swift NERFINISHED ⓘ |
Referenced by (1)
Full triples — surface form annotated when it differs from this entity's canonical label.