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