-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRootViewController.swift
39 lines (30 loc) · 1.21 KB
/
RootViewController.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// RootViewController.swift
// Architectures
//
// Created by jiangbin on 16/3/28.
// Copyright © 2016年 lechange. All rights reserved.
//
import UIKit
class RootViewController: UITableViewController {
private var dataSource = ["PushMVC", "PushMVP", "PushMVVM", "LightViewController"]
override func viewDidLoad() {
super.viewDidLoad()
self.title = "Architecture Patterns"
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.dataSource.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("MyTestCell")
if (cell == nil) {
cell = UITableViewCell.init(style: .Default, reuseIdentifier: "MyTestCell")
}
cell?.textLabel?.text = self.dataSource[indexPath.row]
return cell!
}
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let identifier = self.dataSource[indexPath.row]
self.performSegueWithIdentifier(identifier, sender: nil)
}
}