Last active
July 21, 2017 15:10
Revisions
-
watert revised this gist
Jun 9, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -28,5 +28,5 @@ class ViewController: UIViewController ,UITableViewDelegate, UITableViewDataSour } var ctrl = ViewController() // ctrl.viewDidLoad() //Not needed ctrl.view -
watert renamed this gist
Jun 9, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
watert renamed this gist
Jun 9, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
watert created this gist
Jun 9, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ // Playground - noun: a place where people can play import UIKit class ViewController: UIViewController ,UITableViewDelegate, UITableViewDataSource { var tableView: UITableView! var items: NSMutableArray! override func viewDidLoad() { super.viewDidLoad() self.items = NSMutableArray(array: ["Hello 1","Hello 2","Hello 3"]) self.view.frame = CGRect(x: 0, y: 0, width: 320, height: 480) self.tableView = UITableView(frame:self.view!.frame) self.tableView!.delegate = self self.tableView!.dataSource = self self.tableView!.registerClass(UITableViewCell.self, forCellReuseIdentifier: "cell") self.view?.addSubview(self.tableView) } func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -> Int{ return self.items.count; } func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell!{ let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as UITableViewCell cell.textLabel.text = "\(self.items[indexPath.row])" return cell } } var ctrl = ViewController() ctrl.viewDidLoad() ctrl.view