Skip to content

Instantly share code, notes, and snippets.

@akramhussein
Created March 27, 2016 09:23
Show Gist options
  • Save akramhussein/5fafd9dcaa0dd55d584d to your computer and use it in GitHub Desktop.
Save akramhussein/5fafd9dcaa0dd55d584d to your computer and use it in GitHub Desktop.
Array+RemoveObjectByClass.swift
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