Skip to content

Instantly share code, notes, and snippets.

@a2
Forked from below/gist:475cdfd44550496e0aff
Created February 26, 2015 15:09
Show Gist options
  • Save a2/e14a3ed240205d6daf74 to your computer and use it in GitHub Desktop.
Save a2/e14a3ed240205d6daf74 to your computer and use it in GitHub Desktop.
import UIKit
protocol myProtocol: class {
func dothatthing () -> Void
}
var array : [protocol<myProtocol>] = []
class A : myProtocol {
func dothatthing() {
println("Class A")
}
}
let foo = A()
let bar = A()
array.append(foo)
array.append(bar)
for x in array {
if x === bar {
println("We got it!")
}
else {
println("We have not it")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment