git init
vi .git/config
git add .
git commit -m "begin"
vi .gitignore
2.封裝->重用
a幻件。函數(shù)
b跷叉。類
c嫌吠。庫(kù)
類與類越獨(dú)立越好
緊耦合
面向接口(方法)編程:
a。協(xié)議
b搁拙。閉包
c秒梳。Target - Action
repo update
拆分:
a。使用拓展箕速,減少文件中的代碼
CocoaPods版本(可以寫死)
數(shù)據(jù)類型:
不要直接使用字典酪碘,也不要直接使用swiftyjson解析的數(shù)據(jù)
JSONexport
ObjectMapper
只要有類存在就可以使用靜態(tài)變量:通過(guò)類名調(diào)用,如:
var b :Int! ViewController.b = 123
類變量盐茎,類方法
成員變量爽柒,成員方法(建立對(duì)象)
建立對(duì)象:let v = ViewController()
a喉童。不能直接在類方法中使用成員變量和成員方法
b廊勃。類變量和類方法钢颂,只需要有類名
*****實(shí)現(xiàn)頁(yè)面的切換,獲取rootView
別人傳的時(shí)候:pull
自己傳的時(shí)候:先commit 募谎,再pull扶关,最后再push
3.獲取window:(三種方法)
//1.
// let window = UIApplication.sharedApplication().keyWindow
//2.
// let window = UIApplication.sharedApplication().delegate?.window
//3. 已經(jīng)顯示的視圖
let window = self.view.window
重要的方法:
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
//獲取window
//1.
// let window = UIApplication.sharedApplication().keyWindow
//2.
// let window = UIApplication.sharedApplication().delegate?.window
//3. 已經(jīng)顯示的視圖
let window = self.view.window
let tabBarCtrl = window?.rootViewController as! UITabBarController
let navCtrl = tabBarCtrl.viewControllers?.first as! UINavigationController
let viewCtrl = navCtrl.viewControllers.first
viewCtrl!.view.backgroundColor = UIColor.greenColor()
print(viewCtrl!.view.subviews)
self.dismissViewControllerAnimated(true, completion: nil)
}
七牛
成員方法,類方法
URL
Request Header
Body
GET:URL/Header
POST/PUT:URL/Header/Body
FireFox:HttpRequester
1.在Swift中使用OC代碼
2.HTTP的方法
3.UITextField的代理
4.數(shù)據(jù)傳遞:
—單例保存
—NSUserDefaults
—文件
—NSNotificationCenter 通知
Requestrian:
Content Type:application/x-www-form-urlencoded
separator分割線
nav.diveinedu.com獲取資源
commad + shift + H 返回主界面 command + F 搜索代碼
改變占位符顏色:ForegroundColorAttribute