Chapter 1 - Building Adaptive UI
此章節(jié)主要自動布局及SizeClass的基本使用,并無難度虎眨,純SB操作
Chapter 2 - Adding Sections and Index List in UITableView
本章主要講解了UITableView控件的索引序列弟劲。
需要相似demo的可以去我的github下載祷安,注意是相似的demo。
這里面的Swift_QQ好友列表就是這個功能了兔乞!下載請戳我
C25A7896-0839-4C2C-BECD-719A6E656B17.png
Chapter 3 - Animating Table View Cell
本章主要講了在cell將要顯示的時候汇鞭,加一個動畫效果撇眯,也是簡單的不得了呢。
核心代碼大概就是這個樣子了:
override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
//這里放一個動畫效果虱咧,比如:
let rotationTransform = CATransform3DTranslate(CATransform3DIdentity, -500, 100, 0)
cell.layer.transform = rotationTransform;
UIView.animateWithDuration(1.0, animations: { cell.layer.transform = CATransform3DIdentity })
}
Chapter 4 - Reading and Parsing JSON
這章就更簡單了,教你用NSJSONSerialization解析JSON嘛锚国!
但是書上的代碼是1.2的腕巡,現(xiàn)在Swift出2.0已經(jīng)不好用了,給大家看下核心代碼就ok了血筑,解析JSON用原生框架的還真不知道有多少人绘沉,反正我是不用的。
//其實(shí)就是JSON轉(zhuǎn)字典或者數(shù)組咯豺总,常見的大概就是這樣幾步:
//Step1:先把JSON數(shù)據(jù)文件專程data
//Step2:將data序列化
//Step3:序列化成功
var jsonResult:NSDictionary? = nil
do{
jsonResult = try NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.MutableContainers) as? NSDictionary
}catch{
print("\(error)")
}
Chapter 5 - How to Integrate Twitter and Facebook Sharing
本章就講了使用Social主要是里面的SLComposeViewController來做一個分享功能车伞,目前支持Facebook, Twitter, Sina Weibo, and Tencent Weibo∮髟基本上國內(nèi)沒什么人用了另玖,畢竟大家都用微信,微博表伦,QQ互連的SDK嘛谦去。本章使用了iOS8新增UITableViewRowAction來實(shí)現(xiàn)側(cè)滑,這個比較贊蹦哼。
購買地址:http://www.appcoda.com/intermediate-swift-programming-book/