# 前言

我們將會完成一個完整的應用，展示 Flickr 推薦照片 的瀏覽器應用程式。

通過開發這個應用程式，我們會接觸一些 Cocoa 中常見的設計模式：

* 創建型 (Creational)：單例模式 (Singleton)、簡易工廠模式(Simple Factory)
* 結構型 (Structural)：裝飾者模式 (Decorator)、適配器模式 (Adapter)、外觀模式 (Facade)、MVC、MVP
* 行為型 (Behavioral)：觀察者模式 (Observer)、事件流模式 (Event Flow)

## 聲明

而本書的教學內容，經過改編後，並不適合一開始剛接觸 iOS 開發的新手，而是已經熟悉基本 Swift 撰寫開發以外，並且對於物件導向 OOP 已經有基本概念的開發者進一步學習使用。

1. 已有 OOP 概念。
2. 已熟悉 Swift 程式語言。
3. 已瞭解 Project、Library、WorkSpace 以及 cocoaPods 使用方式。

在 `Xcode 7` 中進行撰寫測試， `Swift 2.1`

## 本書改編自：

* [Swift设计模式 (iOS)](https://www.gitbook.com/book/yourtion/swiftdesignpatterns/details)
* [iOS 中的設計模式 (Swift版本) Part 1](http://blog.callmewhy.com/2014/12/29/introducing-ios-design-patterns-in-swift-part-1/)
* [iOS 中的設計模式 (Swift版本) Part 2](http://blog.callmewhy.com/2015/03/01/introducing-ios-design-patterns-in-swift-part-2/)
* [大話設計模式](http://www.books.com.tw/products/0010430101)

## 完成檔案

[範例完整版](https://github.com/wildenchen/swift-design-patterns/tree/8774a70f22cd1d2123f7e6c90567c20f7cb7c47b/workspaces/FlickrPhotos-Finish.zip)

**作者：雄獅資訊 - 互動系統部 - Wilden**

* <wildenchen@liontravel.com>
* GitBook 編寫


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wilden-chen.gitbook.io/swift-design-patterns/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
