git init
vi .git/config
git add .
git commit -m "begin"
vi .gitignore
2.封裝->重用
a。函數
b。類
c。庫
類與類越獨立越好
緊耦合
面向接口(方法)編程:
a。協議
b。閉包
c。Target - Action
repo update
拆分:
a。使用拓展,減少文件中的代碼
CocoaPods版本(可以寫死)
數據類型:
不要直接使用字典,也不要直接使用swiftyjson解析的數據
JSONexport
ObjectMapper
只要有類存在就可以使用靜態變量:通過類名調用,如:
var b :Int! ViewController.b = 123
類變量,類方法
成員變量,成員方法(建立對象)
建立對象:let v = ViewController()
a。不能直接在類方法中使用成員變量和成員方法
b。類變量和類方法,只需要有類名
*****實現頁面的切換,獲取rootView
別人傳的時候:pull
自己傳的時候:先commit ,再pull,最后再push
3.獲取window:(三種方法)
//1.
// let window = UIApplication.sharedApplication().keyWindow
//2.
// let window = UIApplication.sharedApplication().delegate?.window
//3. 已經顯示的視圖
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. 已經顯示的視圖
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.數據傳遞:
—單例保存
—NSUserDefaults
—文件
—NSNotificationCenter 通知
Requestrian:
Content Type:application/x-www-form-urlencoded
separator分割線
nav.diveinedu.com獲取資源
commad + shift + H 返回主界面 command + F 搜索代碼
改變占位符顏色:ForegroundColorAttribute