Intermediate iOS Programming with Swift!读书笔记

Chapter 1 - Building Adaptive UI

此章节主要自动布局及SizeClass的基本使用,并无难度,纯SB操作

Chapter 2 - Adding Sections and Index List in UITableView

本章主要讲解了UITableView控件的索引序列。

需要相似demo的可以去我的github下载,注意是相似的demo。

这里面的Swift_QQ好友列表就是这个功能了!下载请戳我

Intermediate iOS Programming with Swift!读书笔记_第1张图片
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的,现在Swift出2.0已经不好用了,给大家看下核心代码就ok了,解析JSON用原生框架的还真不知道有多少人,反正我是不用的。

    //其实就是JSON转字典或者数组咯,常见的大概就是这样几步:
    //Step1:先把JSON数据文件专程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。基本上国内没什么人用了,毕竟大家都用微信,微博,QQ互连的SDK嘛。本章使用了iOS8新增UITableViewRowAction来实现侧滑,这个比较赞。

购买地址:http://www.appcoda.com/intermediate-swift-programming-book/

你可能感兴趣的:(Intermediate iOS Programming with Swift!读书笔记)