Last active
August 19, 2023 21:56
-
-
Save amro/52846ea9c6eb3238b793 to your computer and use it in GitHub Desktop.
Using an Instance of NSOrderedSet from 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
// How one might use NSMutableOrderedSet from Swift -- mainly an example of how to | |
// call Objective-C classes from Swift. Pretty much what one would expect. | |
var set = NSMutableOrderedSet() | |
set.addObject("foo"); | |
set.addObject("bar"); | |
set.addObjectsFromArray(["bar", "wee", "foo"]) | |
for i in 0..set.count { | |
println(set.objectAtIndex(i)) | |
} | |
//Output | |
foo | |
bar | |
wee |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated from Aug 19 2023