forked from sahin/mobileplayer-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExamplesTableViewController.swift
50 lines (43 loc) · 1.6 KB
/
ExamplesTableViewController.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
40
41
42
43
44
45
46
47
48
49
50
//
// ExamplesTableViewController.swift
// MobilePlayer
//
// Created by Baris Sencan on 23/11/2015.
// Copyright © 2015 MovieLaLa. All rights reserved.
//
import UIKit
class ExamplesTableViewController: UITableViewController {
private let cellReuseIdentifier = "exampleCell"
private let examples = [
PlainExampleViewController(),
ConfigExampleViewController(),
RemoteConfigExampleViewController(),
ProgConfigExampleViewController(),
AdvancedConfigExampleViewController(),
OverlayExampleViewController(),
TimedOverlayExampleViewController(),
PrerollExampleViewController(),
PauseOverlayExampleViewController(),
PostrollExampleViewController()
]
init() {
super.init(nibName: nil, bundle: nil)
title = "MobilePlayer Examples"
tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: cellReuseIdentifier)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return examples.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier(cellReuseIdentifier, forIndexPath: indexPath)
cell.textLabel?.text = examples[indexPath.row].title
cell.accessoryType = .DisclosureIndicator
return cell
}
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
showViewController(examples[indexPath.row], sender: self)
}
}