Files
libr-ios/librx/SettingTableViewController.swift

53 lines
1.5 KiB
Swift

//
// SettingTableViewController.swift
// librx
//
// Created by Yunlong Zheng on 15/10/13.
// Copyright © 2015年 librx. All rights reserved.
//
import UIKit
class SettingTableViewController: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.whiteColor()]
self.tableView.backgroundColor = UIColor(white: 0.97, alpha: 1)
}
override func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 8.0
}
override func tableView(tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 8.0
}
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
if indexPath.section == 1 && indexPath.row == 0 {
self.logout()
}
}
override func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UITableViewHeaderFooterView()
view.contentView.backgroundColor = UIColor(white: 0.97, alpha: 1)
return view
}
@IBAction func LogoutButtonPressed(sender: AnyObject) {
self.logout()
}
func logout() {
let _ = LogoutAction()
//dismissViewControllerAnimated(true, completion: nil)
performSegueWithIdentifier("logoutSegue", sender: self)
}
}