diff --git a/ios_tips/2016-05-28-Extension-for-removing-objects-in-array-swift.md b/ios_tips/2016-05-28-Extension-for-removing-objects-in-array-swift.md index 4ce9706..46f7978 100644 --- a/ios_tips/2016-05-28-Extension-for-removing-objects-in-array-swift.md +++ b/ios_tips/2016-05-28-Extension-for-removing-objects-in-array-swift.md @@ -8,6 +8,8 @@ tip-description: In swift we don't have methods to remove the particular object, --- #### Code +**Swift2** + extension Array where Element: Equatable { // Returns the indexes of the object @@ -36,3 +38,34 @@ tip-description: In swift we don't have methods to remove the particular object, } } + +**Swift 3** + + extension Array where Element: Equatable { + + // Returns the indexes of the object + public func indexesOf(object: Element) -> [Int] { + var indexes = [Int]() + for index in 0..