Last active
March 22, 2016 18:29
-
-
Save paweljankowski/a510a52afce4b40a3279 to your computer and use it in GitHub Desktop.
Swift arrays
This file contains hidden or 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
import Foundation | |
protocol Foo: AnyObject { } | |
class Bar: Foo { } | |
let z = NSSet(array: [Bar(), Bar()]) | |
let x = z.allObjects as? [Foo] | |
if x != nil { | |
print("Success") | |
} else { | |
print("WTF???") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment