One Logo Pool Ball
Combine · IOS API REFERENCE

Subscribers.Demand

struct · iOS 13.0+ · SDK 27.1

@frozen struct Demand

A requested number of items, sent to a publisher from a subscriber through the subscription.

Members (5)

get · iOS 13.0+

description

TypeScript
get description(): string
Swift declaration
var description: String { get }

A textual representation of this instance. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(describing:)` initializer. This initializer works with any type, and uses the custom `description` property for types that conform to `CustomStringConvertible`: struct Point: CustomStringConvertible { let x: Int, y: Int var description: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(describing: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `description` property.

get · iOS 13.0+

max

TypeScript
get max(): (number) | null
Swift declaration
var max: Int? { get }

The number of requested values. The value is `nil` if the demand is ``Subscribers/Demand/unlimited``.

static · iOS 13.0+

max

TypeScript
static max64605(value: number): Subscribers_Demand
Swift declaration
static func max(_ value: Int) -> Subscribers.Demand

Creates a demand for the given maximum number of elements. The publisher is free to send fewer than the requested maximum number of elements. - Parameter value: The maximum number of elements. Providing a negative value for this parameter results in a fatal error.

get · iOS 13.0+

none

TypeScript
static get none(): Subscribers_Demand
Swift declaration
static let none: Subscribers.Demand

A request for no elements from the publisher. This is equivalent to `Demand.max(0)`.

get · iOS 13.0+

unlimited

TypeScript
static get unlimited(): Subscribers_Demand
Swift declaration
static let unlimited: Subscribers.Demand

A request for as many values as the publisher can produce.

Skipped declarations

No declarations were skipped in this snapshot.

All Combine types →