Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- “func hasAnyMatches(list: [Int], condition: (Int) -> Bool) -> Bool {
- for item in list {
- if condition(item) {
- return true
- }
- }
- return false
- }
- func lessThanTen(number: Int) -> Bool {
- return number < 10
- }
- var numbers = [20, 19, 7, 12]
- hasAnyMatches(list: numbers, condition: lessThanTen)”
- Trecho de: Apple Inc. “The Swift Programming Language (Swift 3.0.1).” iBooks. https://itun.es/br/jEUH0.l
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement