Hands-On Design Patterns with Swift: Master Swift best practices to build modular applications for mobile, desktop, and server platforms
暫譯: Swift 實戰設計模式:掌握 Swift 最佳實踐,構建適用於移動、桌面和伺服器平台的模組化應用程式

Florent Vilmart, Giordano Scalzo, Sergio De Simone

  • 出版商: Packt Publishing
  • 出版日期: 2018-12-21
  • 售價: $1,520
  • 貴賓價: 9.5$1,444
  • 語言: 英文
  • 頁數: 414
  • 裝訂: Paperback
  • ISBN: 1789135567
  • ISBN-13: 9781789135565
  • 相關分類: Apple DeveloperDesign Pattern
  • 立即出貨 (庫存=1)

相關主題

商品描述

From learning about the most sought-after design patterns to a comprehensive coverage of architectural patterns and code testing, this book is all you need to write clean, reusable code

Key Features

  • Write clean, reusable and maintainable code, and make the most of the latest Swift version.
  • Analyze case studies of some of the popular open source projects and give your workflow a huge boost
  • Choose patterns such as MVP, MVC, and MVVM depending on the application being built

Book Description

Swift keeps gaining traction not only amongst Apple developers but also as a server-side language. This book demonstrates how to apply design patterns and best practices in real-life situations, whether that's for new or already existing projects.

You'll begin with a quick refresher on Swift, the compiler, the standard library, and the foundation, followed by the Cocoa design patterns – the ones at the core of many cocoa libraries – to follow up with the creational, structural, and behavioral patterns as defined by the GoF. You'll get acquainted with application architecture, as well as the most popular architectural design patterns, such as MVC and MVVM, and learn to use them in the context of Swift. In addition, you'll walk through dependency injection and functional reactive programming. Special emphasis will be given to techniques to handle concurrency, including callbacks, futures and promises, and reactive programming. These techniques will help you adopt a test-driven approach to your workflow in order to use Swift Package Manager and integrate the framework into the original code base, along with Unit and UI testing.

By the end of the book, you'll be able to build applications that are scalable, faster, and easier to maintain.

What you will learn

  • Work efficiently with Foundation and Swift Standard library
  • Understand the most critical GoF patterns and use them efficiently
  • Use Swift 4.2 and its unique capabilities (and limitations) to implement and improve GoF patterns
  • Improve your application architecture and optimize for maintainability and performance
  • Write efficient and clean concurrent programs using futures and promises, or reactive programming techniques
  • Use Swift Package Manager to refactor your program into reusable components
  • Leverage testing and other techniques for writing robust code

Who this book is for

This book is for intermediate developers who want to apply design patterns with Swift to structure and scale their applications. You are expected to have basic knowledge of iOS and Swift.

Table of Contents

  1. Refreshing the Basics
  2. Understanding ARC and Memory Management
  3. Diving into Foundation and the Standard Library
  4. Working with Objective-C in a Mixed Code Base
  5. Creational Patterns
  6. Structural Patterns
  7. Behavioral Patterns
  8. Swift-Oriented Patterns
  9. Using the Model-View-Controller Pattern
  10. Model-View-ViewModel in Swift
  11. Implementing Dependency injection
  12. Futures, Promises, and Reactive Programming
  13. Modularize Your Apps with Swift Package Manager
  14. Testing Your Code with Unit and UI Tests
  15. Going Out in the Open (Source)

商品描述(中文翻譯)

**從學習最受歡迎的設計模式到全面涵蓋架構模式和代碼測試,這本書是您撰寫乾淨、可重用代碼所需的一切**

### 主要特點
- 撰寫乾淨、可重用且易於維護的代碼,充分利用最新的 Swift 版本。
- 分析一些流行的開源項目的案例研究,為您的工作流程帶來巨大提升。
- 根據所構建的應用程序選擇模式,如 MVP、MVC 和 MVVM。

### 書籍描述
Swift 不僅在 Apple 開發者中越來越受歡迎,還作為伺服器端語言獲得了廣泛應用。本書展示了如何在實際情況中應用設計模式和最佳實踐,無論是針對新項目還是已存在的項目。

您將從 Swift、編譯器、標準庫和基礎知識的快速回顧開始,接著介紹 Cocoa 設計模式——這些模式是許多 Cocoa 庫的核心——然後跟隨 GoF 定義的創建型、結構型和行為型模式。您將熟悉應用程序架構以及最流行的架構設計模式,如 MVC 和 MVVM,並學會在 Swift 的上下文中使用它們。此外,您將學習依賴注入和函數式反應式編程。特別強調將會放在處理併發的技術上,包括回調、未來和承諾,以及反應式編程。這些技術將幫助您採用測試驅動的方法來優化工作流程,以便使用 Swift Package Manager 並將框架整合到原始代碼庫中,並進行單元測試和 UI 測試。

到書籍結束時,您將能夠構建可擴展、更快且更易於維護的應用程序。

### 您將學到什麼
- 高效使用 Foundation 和 Swift 標準庫
- 理解最關鍵的 GoF 模式並高效使用它們
- 使用 Swift 4.2 及其獨特的功能(和限制)來實現和改進 GoF 模式
- 改進您的應用程序架構,優化可維護性和性能
- 使用未來和承諾或反應式編程技術撰寫高效且乾淨的併發程序
- 使用 Swift Package Manager 將您的程序重構為可重用的組件
- 利用測試和其他技術撰寫穩健的代碼

### 本書適合誰
本書適合希望使用 Swift 應用設計模式來結構和擴展其應用程序的中級開發者。您應具備基本的 iOS 和 Swift 知識。

### 目錄
1. 基礎知識回顧
2. 理解 ARC 和內存管理
3. 深入了解 Foundation 和標準庫
4. 在混合代碼庫中使用 Objective-C
5. 創建型模式
6. 結構型模式
7. 行為型模式
8. Swift 專用模式
9. 使用模型-視圖-控制器模式
10. 在 Swift 中的模型-視圖-視圖模型
11. 實現依賴注入
12. 未來、承諾和反應式編程
13. 使用 Swift Package Manager 模組化您的應用
14. 使用單元測試和 UI 測試測試您的代碼
15. 開放源碼的探索