-
Notifications
You must be signed in to change notification settings - Fork 139
/
Copy pathBaseViewController.swift
58 lines (45 loc) · 1.53 KB
/
BaseViewController.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
51
52
53
54
55
56
57
58
//
// BaseViewController.swift
// itjh_ios
//
// Created by LijunSong on 15/3/20.
// Copyright (c) 2015年 LijunSong. All rights reserved.
//
import UIKit
/**
基础ViewController
*/
class BaseViewController: UIViewController {
//标题
var navigationTitle = UILabel()
//页码
var PAGE_NUM = 0
//一页要现实的数量
let SHOW_NUM = 20
//cell 标识符
let identifier = "cell"
//文章列表数据
var dataSource:[Article] = []
override func viewDidLoad() {
super.viewDidLoad()
let iOS7:Bool = Define.ifIOS7()
let screenHeight:CGFloat = Define.screenHeight()
let screenWidth:CGFloat = Define.screenWidth()
//设置Nav
if iOS7==true {
navigationTitle.frame = CGRect(x:(screenWidth-200)/2,y:20.0,width:200,height:44)
}else{
navigationTitle.frame = CGRect(x:(screenWidth-200)/2,y:0.0,width:200,height:44)
}
self.view.backgroundColor = UIColor.groupTableViewBackgroundColor()
self.navigationTitle.text = "IT江湖"
self.navigationTitle.textColor=UIColor.whiteColor()
navigationTitle.backgroundColor = UIColor.clearColor()
navigationTitle.textAlignment = NSTextAlignment.Center
self.navigationItem.titleView = navigationTitle
self.navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .Plain, target: nil, action: nil)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
}