-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTableViewController.swift
More file actions
34 lines (26 loc) · 979 Bytes
/
Copy pathTableViewController.swift
File metadata and controls
34 lines (26 loc) · 979 Bytes
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
//
// TableViewController.swift
// StackControllerExample
//
// Created by Blaine Fahey on 3/20/16.
// Copyright © 2016 Blaine Fahey. All rights reserved.
//
import UIKit
class TableViewController: UITableViewController {
private func updateContentSize() {
preferredContentSize = tableView.rectForSection(0).size
}
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
updateContentSize()
}
override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
coordinator.animateAlongsideTransition(nil) { [unowned self] context in
self.updateContentSize()
}
}
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
HelloImCallie.openInSafari()
}
}