Learning Swift Programming Paperback (學習 Swift 程式設計 (平裝版))
Jacob Schatz
- 出版商: Addison Wesley
- 出版日期: 2015-01-10
- 定價: $1,400
- 售價: 6.0 折 $840
- 語言: 英文
- 頁數: 300
- 裝訂: Paperback
- ISBN: 0133950409
- ISBN-13: 9780133950403
-
相關分類:
Apple Developer
立即出貨(限量) (庫存=2)
相關主題
商品描述
Get started fast with Swift programming for iOS and OS X
Learning Swift Programming is a fast-paced, hands-on introduction to writing production-quality iOS and OS X apps with Apple’s new programming language. Written for developers with previous experience in any other modern language, this book explains Swift simply and clearly, using relevant examples that solve realistic problems.
Author Jacob Schatz’s popular Skip Wilson video tutorials on YouTube have already helped thousands of Apple developers get started with Swift. Now, he helps you take full advantage of Swift’s advanced design, remarkable performance, and streamlined development techniques.
Step-by-step, you’ll move from basic syntax through advanced features such as closures and generics–discovering helpful tips and tricks along the way. After you’ve mastered Swift’s building blocks and learned about its key innovations, a full section of case studies walks you through building complete apps from scratch.
- Compare Swift with Objective-C, JavaScript, Python, Ruby, and C
- Collect data with arrays and dictionaries, and store it with variables and constants
- Group commonly-used code into functions for easy reuse
- Structure your code with enums, structs, and classes
- Use generics to get more done with less code
- Write closures to share small blocks of functionality
- Use optionals to write more robust, crash-resistant, and cleaner code
- Integrate existing Objective-C code into new Swift apps
- Program on the bit and byte level with advanced operators
- Implement efficient design patterns with protocols and delegates
- Create animated 2D games with SpriteKit, and 3D games with SceneKit
Contents at a Glance
1 Getting Your Feet Wet
Building Blocks of Swift
Optionals: A Gift to Unwrap
Tuples
Number Types and Converting Between Them
Coming to Swift from Objective-C and C
2 Collecting Data
Using Arrays
Modifying Arrays
Using Dictionaries
3 Making Things Happen: Functions
Defining Functions
More on Parameters
4 Structuring Code: Enums, Structs, and Classes
Enums
Structs
5 Making a Game
Building a User Interface (UI)
The Action-Packed View Controller
6 Reusable Code: Closures
What Are Closures?
Closures in Other Languages
How Closures Work and Why They’re Awesome
7 Subscripts and Advanced Operators
Writing Your First Subscript
Bits and Bytes with Advanced Operators
Customizing Operators
Making Your Own Operators
Bits and Bytes in Real Life
8 Protocols
Writing Your First Protocol
Animizable and Humanizable
Delegation
Protocols as Types
Protocols in Collections
Optional Chaining
9 Becoming Flexible with Generics
The Problem That Generics Solve
10 Games with SpriteKit
Setting Up the Project
The Start Screen
Dangerous Ground
A Hero to the Rescue
Enemies in Motion
Spawned Obstacles
Smashing Physics
11 Games with SceneKit
Creating DAE Files
Creating a New SceneKit Project
Your SceneKit Files
Making the Game
Bridging the Gap to Objective-C
12 Apps with UIKit
Application Types
Loading a Table View
Loading Data from a URL
商品描述(中文翻譯)
快速入門Swift程式設計,針對iOS和OS X。《學習Swift程式設計》是一本快節奏、實踐性強的介紹,教你如何使用蘋果的新程式語言撰寫高品質的iOS和OS X應用程式。本書針對已具備其他現代程式語言經驗的開發者,以簡單明瞭的方式解釋Swift,並提供解決實際問題的相關範例。
作者Jacob Schatz在YouTube上的熱門Skip Wilson視頻教程已幫助數千名蘋果開發者入門Swift。現在,他將幫助你充分利用Swift的先進設計、卓越性能和簡化開發技術。
逐步進行,從基本語法到閉包和泛型等高級功能,並在此過程中發現有用的技巧和訣竅。在掌握了Swift的基礎結構和關鍵創新後,一整節的案例研究將引導你從頭開始建立完整的應用程式。
- 比較Swift與Objective-C、JavaScript、Python、Ruby和C
- 使用陣列和字典收集資料,並使用變數和常數儲存資料
- 將常用程式碼分組為函式以便輕鬆重複使用
- 使用列舉、結構和類別組織程式碼
- 使用泛型以更少的程式碼完成更多工作
- 撰寫閉包以共享小塊功能
- 使用可選型撰寫更健壯、防止崩潰且更乾淨的程式碼
- 將現有的Objective-C程式碼整合到新的Swift應用程式中
- 使用高級運算子在位元和位元組級別進行程式設計
- 使用協議和委派實現高效的設計模式
- 使用SpriteKit創建2D動畫遊戲,使用SceneKit創建3D遊戲
《內容一覽》
1. 入門
Swift的基礎結構
可選型:一份禮物
元組
數字類型及其之間的轉換
從Objective-C和C轉到Swift
2. 收集資料
使用陣列
修改陣列
使用字典
3. 讓事情發生:函式
定義函式
更多關於參數
4. 結構化程式碼:列舉、結構和類別
列舉
結構
5. 做一個遊戲
建立使用者介面(UI)
充滿動作的視圖控制器
6. 可重複使用的程式碼:閉包
什麼是閉包?
其他語言中的閉包
閉包的工作原理及其優點
7. 下標和高級運算子
撰寫第一個下標
使用高級運算子的位元和位元組
自定義運算子
創建自己的運算子
現實生活中的位元和位元組
8. 協議
撰寫第一個協議
可動畫和可人性化
委派
協議作為類型
集合中的協議
可選鏈接
9. 通過泛型變得靈活
泛型解決的問題
10. 使用SpriteKit的遊戲
設置專案
開始畫面
危險地帶
英雄的拯救
移動中的敵人
生成的障礙物
粉碎物理效果
11. 使用SceneKit的遊戲
創建DAE檔案
創建新的SceneKit專案
你的SceneKit檔案
製作遊戲