splash/Sources/Splash/Extensions/Equatable/Equatable+AnyOf.swift

18 lines
324 B
Swift
Raw Normal View History

2018-08-24 18:42:07 +02:00
/**
* Splash
* Copyright (c) John Sundell 2018
* MIT license - see LICENSE.md
*/
import Foundation
extension Equatable {
func isAny(of candidates: Self...) -> Bool {
return candidates.contains(self)
}
func isAny(of candidates: [Self]) -> Bool {
return candidates.contains(self)
}
}