Instance Method


Publishes the maximum value received from the upstream publisher, using the provided ordering closure.


func max(by areInIncreasingOrder: @escaping (Upstream.Output, Upstream.Output) -> Bool) -> Publishers.Comparison<Publishers.Share<Upstream>>



A closure that receives two elements and returns true if they are in increasing order.

Return Value

A publisher that publishes the maximum value received from the upstream publisher, after the upstream publisher finishes.


After this publisher receives a request for more than 0 items, it requests unlimited items from its upstream publisher.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software