On this page
ControlNotificationStream.allSatisfy(_:)
- Declared in
- ControlNotificationStream
- Package
- libtmux-swift
-
Returns a Boolean value that indicates whether all elements produced by the asynchronous sequence satisfy the given predicate.
In this example, an asynchronous sequence called
CounterproducesIntvalues from1to10. TheallSatisfy(_:)method checks to see whether all elements produced by the sequence are less than10.let allLessThanTen = await Counter(howHigh: 10) .allSatisfy { $0 < 10 } print(allLessThanTen) // Prints "false"
The predicate executes each time the asynchronous sequence produces an element, until either the predicate returns
falseor the sequence ends.If the asynchronous sequence is empty, this method returns
true.- Parameter predicate: A closure that takes an element of the asynchronous sequence as its argument and returns a Boolean value that indicates whether the passed element satisfies a condition.
- Returns:
trueif the sequence contains only elements that satisfypredicate; otherwise,false.
- Raises
0 declared, 0 inherited