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
import UIKit | |
class BasicTableViewController: UITableViewController { | |
var tableData = [String]() | |
var selectedCellIndexPath: NSIndexPath? | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
for i in 1...100 { |
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
//save dict to userDefaults | |
var data = NSKeyedArchiver.archivedDataWithRootObject(places) | |
NSUserDefaults.standardUserDefaults().setObject(data, forKey: "places") | |
//load | |
var data = NSUserDefaults.standardUserDefaults().objectForKey("places") as! NSData | |
places = NSKeyedUnarchiver.unarchiveObjectWithData(data) as! [Dictionary<String,String>] |