I have upgraded the project from Swift 3 to Swift 4, but the compiler suggested that the conditions in the if can not call value of non-function type 'AnyClass' (aka 'AnyObject.Type'). How to solve this?
func getHandler(_ type:AnyClass) -> CSHandler? {
for handler in handlers {
if type(of: handler) === type {
return handler
}
}
return nil
}