Hands Design Patterns Swift Applications - Programming Ebook


Download Programming Ebook

Tuesday, February 4, 2020

Hands Design Patterns Swift Applications

Hands Design Patterns Swift Applications
Hands Design Patterns Swift Applications

Book Details 
             TitleHands Design Patterns Swift Applications
         AuthorFlorent Vilmart Giordano Scalzo Sergio De Simone 
     Publisher: Packt
    Language: English
        SubjectSwift / Computers & Technology / Programming / Apple Programming
No. of pages: 401
         Format: PDF, EPUB, Source Code

Master Swift best practices to build modular applications for mobile, desktop, and server platforms


Hands-on Design Patterns in Swift provides a complete overview of how to implement classic design patterns in Swift. Swift is a modern language, and for users coming from a purely object-oriented language background, it may feel overwhelming. It has peculiar characteristics that create new programming paradigms, such as protocol programming, and appropriate solutions to problems such as type erasure. Both of these are covered in this book.
Design patterns do not live in isolation, however, but they help to solve real-world problems. Particular attention is given to presenting them in a number of realistic scenarios.
The goal of Swift is to create robust and maintainable apps, be they mobile or server. However, well-known techniques such as dependency injection and automatic testing are taken from other programming languages.
Finally, since most of the modern software relies upon open source, the final chapter shows how to release and maintain a Swift open source package.

Who this book is for

This book is designed for intermediate and advanced developers who already have experience of another programming language and some experience of Swift.
Those readers with no previous experience in Swift may find an examination of the basics in the first part of the book beneficial.

All Books From Ray Wenderlich

The second part demonstrates how to implement the classic creational, behavioral, and structural design patterns, as well as those peculiar to Swift patterns. In this section, experienced developers will find both similarities and differences with their favorite programming language.
This isn't an academic book, but it aspires to show readers how to implement an app in a pragmatic and practical way. Consequently, the third part is devoted to how to implement an application architecture, presenting patterns such as MVC and MVVM, as well as how to create a couple of modules loosely with dependency injection, and how to handle asynchronous code with futures, promises and reactive programming.

The final part shows how to make apps robust and maintainable. After providing advanced readers with an overview of the Swift testing ecosystem, particular attention is given to the open source maintainers between the readers, showing how to release and maintain a Swift open source package or app.

What this book covers

Chapter 1, Refreshing the Basics, introduces the building blocks that facilitate the writing of Swift code: classes, structs, enums, functions, and closures. Those basics are essential to the Swift language and for successfully applying efficient design patterns and best practices.

Chapter 2, Understanding ARC and Memory Management, describes the particular memory management strategy Swift uses. From its origins in Objective-C, during the pre-ARC era, to today, we'll discover how to properly manage our memory and object life cycles.

Chapter 3, Diving into Foundation and the Swift Standard Library, discusses the powerful framework that comes with Swift. Alongside basic data structures such as arrays and dictionaries, it also comes with a fully featured concurrency management abstraction library (GCD), a full modern networking API (URLSession), and many more features besides.

Chapter 4, Working with Objective-C in a Mixed Code Base, covers the basics of interoperability, nullability, naming conventions, and lightweight generics, as well as the common pitfalls to avoid when bringing Objective-C code to Swift.

Chapter 5, Creational Patterns, dives into the traditional creational design patterns. Examples of Singleton, Abstract Factories, Prototype, Factory, and Builder are shown by means of detailed use cases.

Chapter 6, Structural Patterns, explores the most popular structural patterns, starting with the adapter pattern. We'll follow that up with implementing decorators, facades, and proxies, and finish with exploring composite, bridge, and flyweight patterns.

Chapter 7, Behavioral Patterns, shows patterns that identify common communication strategies between different entities. We'll see examples of the state pattern, observer/observable, memento, visitor, and the strategy pattern.

Chapter 8, Swift-Oriented Patterns, presents patterns peculiar to Swift. After introducing protocol programming, it shows how to implement the classic template pattern using protocol programming. Finally, it shows the type erasure pattern, a powerful tool for mastering generics.

Chapter 9, Using the Model-View-Controller Pattern, explores some best practices and decoupling strategies to keep the view controllers as lean as they should be. The classic Model View Controller pattern is discussed, as are other popular controllers available in UIKit and AppKit.

Chapter 10, Model-View-ViewModel in Swift, explores an extension of MVC, the Model- View-ViewModel pattern. MVVM is a very popular and flexible pattern that avoids the "bloated view controller" effect.

Chapter 11, Implementing Dependency Injection, covers the different flavors of dependency injection and examines how each can solve a particular set of problems in real-world scenarios.

Chapter 12, Futures, Promises, and Reactive Programming, discusses how to solve the most common asynchronous code problems. It explores futures and promises as an encapsulation of work being done. Finally, it provides an overview of signals and reactive programming.

Chapter 13, Modularize Your Apps with Swift Package Manager, shows how Swift Package Manager can power your workflow and keep your project in check, all while increasing the modularity and maintainability of your code base.

Chapter 14, Testing Your Code with Unit and UI Tests, shows how to write unit tests, what they are, what you should look for, and how to get started with testability. The chapter on dependency injection concludes with a presentation of the different types of test doubles to test in isolation, along with an introduction to UI testing.
Chapter 15, Going Out in the Open (Source), discusses the steps required before you can put your project in the open, documenting the source code with Jazzy, using continuous integration with Travis, and automating release with Fastlane. 

No comments:

Post a Comment