Hands-On Design Patterns with Swift: Master Swift best practices to build modular applications for mobile, desktop, and server platforms

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 不僅在蘋果開發者中獲得了越來越多的關注,也成為了一種服務器端語言。本書演示了如何在現實情況中應用設計模式和最佳實踐,無論是對於新項目還是已有項目。

您將從快速複習 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. 走向開放(源碼)