AppSettingViewController.swift 3.13 KB
//
//  AppSettingViewController.swift
//  YouerLiveVideo
//
//  Created by 左丞 on 2017/5/23.
//  Copyright © 2017年 左丞. All rights reserved.
//

import UIKit

class AppSettingViewController: UIViewController {
    var titleArr:[String] = ["密码修改"]
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        self.tabBarController?.tabBar.isHidden = true
    }
    
    override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)
        self.tabBarController?.hidesBottomBarWhenPushed = false
    }


    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}

extension AppSettingViewController:UITableViewDelegate,UITableViewDataSource{
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! AppSettingCell
        cell.titleName.text = titleArr[indexPath.row]
        return cell
    }
    
    func numberOfSections(in tableView: UITableView) -> Int {
         return titleArr.count
    }
    
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
         return 1
    }
    
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        switch indexPath.section {
        case 0:
            let vc = Story.instantiateViewControllerWithIdentifier("ChangePassWordViewControllerVC", storyName: "User") as! ChangePassWordViewController
            vc.title = "密码修改"
            self.navigationController?.pushViewController(vc, animated: true)
            break
        default:
            break
        }
    }
    
    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
        let view = UILabel(frame: CGRect(x:0,y:0,width:getScreenWidth(),height:1))
        view.backgroundColor = tableView.backgroundColor
        return view
    }
    
    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
        let view = UILabel(frame: CGRect(x:0,y:0,width:getScreenWidth(),height:15))
        view.backgroundColor = tableView.backgroundColor
        return view

    }
    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
        return 1
    }
    
    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
        return 15
    }
}



class AppSettingCell: UITableViewCell {
    
    
    @IBOutlet weak var titleName: UILabel!
    
}