Created
December 12, 2016 17:02
-
-
Save khanlou/a5568bcf9a6233f3cf2aa87119e7f520 to your computer and use it in GitHub Desktop.
Converting an Array into an NSArray
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 | |
| let a = ["Asdf", "asdf"] | |
| let nsArray1: NSMutableArray = a.reduce(NSMutableArray(), { array, task in array.add(task); return array }) | |
| nsArray1 | |
| let nsArray2 = NSArray(objects: a) | |
| let nsArray3 = NSArray(array: a) | |
| let nsArray4 = a as NSArray |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment