Created
January 10, 2018 07:17
-
-
Save leoiphonedev/40a894ff530b409d44e64c7ae7a7fbc5 to your computer and use it in GitHub Desktop.
Populating our employee Array with dummy data in order to create csv file
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
class ViewController: UIViewController { | |
var employeeArray:[Dictionary<String, AnyObject>] = Array() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
for i in 1...10 { | |
var dct = Dictionary<String, AnyObject>() | |
dct.updateValue(i as AnyObject, forKey: "EmpID") | |
dct.updateValue("NameForEmplyee id = \(i)" as AnyObject, forKey: "EmpName") | |
employeeArray.append(dct) | |
} | |
} | |
} |
@revolter The gist was published on 10 jan 2018 and answer given on stack overflow was asked on 26 April 2019. So whoβs stealing here. πππππ»
Ah, wow, apologies ππ»ββοΈ It's just that I got sick and tired of random websites just scraping StackOverflow for views, and I mistakenly didn't verify the dates π I edited that answer, to make things straight.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice job stealing https://iostutorialjunction.com/2018/01/create-csv-file-in-swift-programmatically.html from https://stackoverflow.com/a/55870521/20147323 ππ»