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 程式設計 是一本快速且實作導向的書籍,介紹如何使用 Apple 的新程式語言撰寫生產級的 iOS 和 OS X 應用程式。這本書是為有其他現代語言經驗的開發者所寫,簡單明瞭地解釋了 Swift,並使用相關範例來解決現實問題。
作者 Jacob Schatz 在 YouTube 上的熱門 Skip Wilson 視頻教程已經幫助成千上萬的 Apple 開發者開始使用 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 檔案
創建遊戲
橋接到 Objective-C
12 使用 UIKit 的應用程式
應用程式類型
加載表格視圖
從 URL 加載數據