func findIndex<T: Equatable>(array: [T], valueToFind: T) -> Int? {
for (index, value) in enumerate(array) {
if value == valueToFind {
return index
}
}
return nil
}
- (NSUInteger) findIndexWithArray:(NSArray *) array valueToFind: (NSObject *) value {
NSInteger index = -1;
for(;index < array.count; ++index) {
if ([array[index] isEqual:value]) {
return index;
}
}
return index;
}