1. 布局框架
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target '<Your Target Name>' do
pod 'SnapKit', '~> 4.0.0'
end
pod install
2.導(dǎo)入類庫(kù)
import SnapKit
class MyViewController: UIViewController {
lazy var box = UIView()
override func viewDidLoad() {
super.viewDidLoad()
self.view.addSubview(box)
box.snp.makeConstraints { (make) -> Void in
make.width.height.equalTo(50)
make.center.equalTo(self.view)
}
}
}
2.Hero(視圖控制器轉(zhuǎn)換)
- github地址
- Hero 是一個(gè)建立 iOS 視圖控制器轉(zhuǎn)換的庫(kù),它在 UIKit 繁瑣的轉(zhuǎn)換 API 之上提供了一個(gè)聲明層 - 為開發(fā)人員提供了一個(gè)簡(jiǎn)單的任務(wù)。
3.ViewAnimator(構(gòu)建UIView動(dòng)畫)
- github地址
- UITableView, UICollectionView and UIStackView 需要查看Demo
pod "ViewAnimator"
let animation = AnimationType.from(direction: .top, offset: 30.0)
view.animate(animations: [animation])
4.SpreadsheetView(電子表格視圖)
5.圖片加載緩存
- Kingfisher(取自于SDWebImage)
- HanekeSwift (輕量帶緩存高性能圖片加載組件)
6.font, color
- Hue (集成color功用的庫(kù),使用的是hex顏色值)
7. json解析
8.網(wǎng)絡(luò)
- Alamofire (http網(wǎng)絡(luò)請(qǐng)求事件處理的框架)
- Moya (基于Alamofire的更高層網(wǎng)絡(luò)請(qǐng)求封裝抽象層)
- Reachability (用來檢查應(yīng)用當(dāng)前的網(wǎng)絡(luò)連接狀況)