<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Combine",
  "identifier" : "/documentation/Combine/Subscribers/Demand/max(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Combine"
    ],
    "preciseIdentifier" : "s:7Combine11SubscribersO6DemandV3maxyAESiFZ"
  },
  "title" : "max(_:)"
}
-->

# max(_:)

Creates a demand for the given maximum number of elements.

```
static func max(_ value: Int) -> Subscribers.Demand
```

## Parameters

`value`

The maximum number of elements. Providing a negative value for this parameter results in a fatal error.

## Discussion

The publisher is free to send fewer than the requested maximum number of elements.

---

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)