使用Swift的iOS设计模式实现 [英] iOS Design Pattern Implementation with Swift

查看:144
本文介绍了使用Swift的iOS设计模式实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是读了一篇关于iOS设计模式的文章,并对我如何在自己的应用程序中实现它们感到困惑。我如何知道要实现的模式和在我的应用程序中实现它的位置。此外,API的目的是什么,以及如何在我的应用程序中实现一个。

I just read a post about iOS design patterns and am confused on how I could implement them in my own app. How do I know what pattern to implement and where in my app to implement it. Also, what is the purpose of the API and how can I implement one into my app.

可以在这里找到帖子:

&     Swift中的设计模式介绍 - 第1部分: http://www.raywenderlich.com/86477/introducing-ios-design-patterns-in-swift-part-1

    在Swift中介绍设计模式 - 第2部分: http: //www.raywenderlich.com/90773/introducing-ios-design-patterns-in-swift-part-2

The posts can be found here:
    Introducing Design Patterns in Swift - Part 1: http://www.raywenderlich.com/86477/introducing-ios-design-patterns-in-swift-part-1
    Introducing Design Patterns in Swift - Part 2: http://www.raywenderlich.com/90773/introducing-ios-design-patterns-in-swift-part-2

感谢,
wviper3

Thanks, wviper3

推荐答案

就像英语有常见的表达式和语法一样,iOS有常用的方法来做事情和模式。你的问题意味着需要使用一堆设计模式,但这是错误的方式来思考它。 iOS已经为你设置了这些(像Model View Controller和Singleton类,如UIApplication和NSNotificationCenter)。设计模式是可用的工具,没有压力使用它们。

Just like how the English language has common expressions and syntax, iOS has common ways to do things and "patterns". Your question implies a need to use a bunch of design patterns, but that's the wrong way to think about it. iOS is already setting these up for you (like the Model View Controller and Singleton classes like UIApplication and NSNotificationCenter). The design patterns are tools you have available, there is no pressure to use a bunch of them.

这篇关于使用Swift的iOS设计模式实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆