Sesame-iOS/Sesame/Common/Extensions/Array+Extensions.swift
2023-12-12 17:33:42 +01:00

15 lines
264 B
Swift

import Foundation
extension Array {
func count(where closure: (Element) -> Bool) -> Int {
var result = 0
forEach { element in
if closure(element) {
result += 1
}
}
return result
}
}