Created
March 27, 2016 09:23
-
-
Save akramhussein/5fafd9dcaa0dd55d584d to your computer and use it in GitHub Desktop.
Array+RemoveObjectByClass.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Array | |
{ | |
mutating func removeObjectByClass<T>(t: T.Type) | |
{ | |
for (index, object) in self.enumerate() | |
{ | |
if let _ = object as? T | |
{ | |
self.removeAtIndex(index) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment