Skip to content

Instantly share code, notes, and snippets.

@chaitanyaSoni96
Created June 14, 2019 11:02
Show Gist options
  • Save chaitanyaSoni96/0d751994b25edab8dc109ab85d9e9cc0 to your computer and use it in GitHub Desktop.
Save chaitanyaSoni96/0d751994b25edab8dc109ab85d9e9cc0 to your computer and use it in GitHub Desktop.
Swift Extensions
extension Array where Element:Equatable {
func removeDuplicates() -> [Element] {
var result = [Element]()
for value in self {
if result.contains(value) == false {
result.append(value)
}
}
return result
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment