簡(jiǎn)介
網(wǎng)絡(luò)請(qǐng)求-Alamofire
Alamofire 是在蘋果 URL Loading System 基礎(chǔ)上封裝的網(wǎng)絡(luò)庫(kù),簡(jiǎn)單易用并且可擴(kuò)展。
https://github.com/Alamofire/Alamofire
基本用法
-
AF 命名空間,鏈?zhǔn)秸{(diào)用。
02
JSON - SwiftyJSON
- https://github.com/SwiftyJSON/SwiftyJSON
- SwiftyJSON makes it easy to deal with JSON data in Swift.
標(biāo)準(zhǔn)庫(kù)擴(kuò)展 - Dollar
- https://github.com/ankurp/Dollar
- https://www.dollarswift.org/
- Dollar is a Swift library that provides useful functional programming helper methods without extending any built in objects. It is similar to Lo-Dash or Underscore.js in Javascript.
Array
Dictionary
Object
Function
Chaining
- curry (柯里化): 是把接受多個(gè)參數(shù)的函數(shù)變換成接受一個(gè)單一參數(shù)(最初函數(shù)的第一個(gè)參數(shù))的 函數(shù),并且返回接受余下的參數(shù)而且返回結(jié)果的新函數(shù)的技術(shù)。
自動(dòng)布局 - SnapKit
- https://github.com/SnapKit/SnapKit
- SnapKit is a DSL to make Auto Layout easy on both iOS and OS X.
圖片加載和緩存 - Kingfisher
- https://github.com/onevcat/Kingfisher
- Kingfisher is a powerful, pure-Swift library for downloading and caching images from the web. It provides you a chance to use a pure-Swift way to work with remote images in your next app.
優(yōu)雅地使用資源 - R.Swift
Get strong typed, autocompleted resources like images, fonts and segues in Swift projects.
在當(dāng)前項(xiàng)目的 targets 中選擇 Build phrase,點(diǎn)擊+號(hào)選擇添加 New Run Script Phase。
將 Run Script 移動(dòng)至 Compile sources 之上, Check Pods Manifest.lock 之下。在 Run Script 中添加:"
SRCROOT"。
編譯你的項(xiàng)目,在 Finder 中你會(huì)看到 R.generated.swift 在工程中,將該文件拖動(dòng)至項(xiàng)目中,切記 千萬不要勾選 Copy items if needed。
每當(dāng)項(xiàng)目build時(shí),R.swift開始運(yùn)行
這個(gè)文件根據(jù)項(xiàng)目里的資源文件自動(dòng)在 R.generated.swift 文件中按照類型生成結(jié)構(gòu)體 強(qiáng)類型,無需類型判斷和轉(zhuǎn)換,自動(dòng)返回對(duì)應(yīng)類型
支持多種資源類型
自動(dòng)完成,無需猜測(cè)圖像名稱,避免資源名稱拼寫錯(cuò)誤
社交分享 - MonkeyKing
- https://github.com/nixzhu/MonkeyKing
- MonkeyKing helps you post messages to Chinese Social Networks, without their buggy SDKs.