iOS 设计模式资料整理
SherryNicol
8年前
<p>iOS 设计模式相关资料整理 随着写代码时间变长,业务逻辑越来越复杂,项目就会变的越来越臃肿,业务的拓展、Bug Fix将会越来越难进展。接着进行的就是重构工作,对重构而已,那设计模式、架构、当前的业务情况、将来可能遇到的需求 将是下一步的思考。本文将从设计模式、架构、实践三个方面梳理 iOS 架构设计。</p> <p>设计模式 经典图书系列</p> <ul> <li>《Head First设计模式》 <a href="https://www.amazon.cn/Head-First%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F-%E5%BC%97%E9%87%8C%E6%9B%BC/dp/B0011FBU34/ref=sr_1_1?ie=UTF8&qid=1464418055&sr=8-1&keywords=head+first" rel="nofollow,noindex">纸质版-亚马逊</a> <a href="/misc/goto?guid=4959746274401304307" rel="nofollow,noindex">电子版-PDF-CSDN</a></li> <li>《大话设计模式》 <a href="https://www.amazon.cn/%E5%A4%A7%E8%AF%9D%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F-%E7%A8%8B%E6%9D%B0/dp/B0011FHN5S/ref=sr_1_1?ie=UTF8&qid=1464418409&sr=8-1&keywords=%E5%A4%A7%E8%AF%9D%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F" rel="nofollow,noindex">纸质版-亚马逊</a> <a href="/misc/goto?guid=4959625413468621097" rel="nofollow,noindex">源码及电子书-CSDN</a></li> <li>《设计模式》Gof <a href="https://www.amazon.cn/%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%A7%91%E5%AD%A6%E4%B8%9B%E4%B9%A6-%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F-%E5%8F%AF%E5%A4%8D%E7%94%A8%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E8%BD%AF%E4%BB%B6%E7%9A%84%E5%9F%BA%E7%A1%80-Erich-Gamma/dp/B001130JN8/ref=sr_1_1?ie=UTF8&qid=1464419128&sr=8-1&keywords=%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F" rel="nofollow,noindex">纸质版-亚马逊</a> <a href="/misc/goto?guid=4959746274680541988" rel="nofollow,noindex">电子书-PDF-CSDN</a></li> <li>Objective-C编程之道:iOS 设计模式 <a href="https://www.amazon.cn/Objective-C%E7%BC%96%E7%A8%8B%E4%B9%8B%E9%81%93-iOS%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F%E8%A7%A3%E6%9E%90-%E9%92%9F%E5%86%A0%E8%B4%A4/dp/B0065V3ALO/ref=sr_1_1?ie=UTF8&qid=1464418960&sr=8-1&keywords=Objective-C%E7%BC%96%E7%A8%8B%E4%B9%8B%E9%81%93%EF%BC%9AiOS+%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F" rel="nofollow,noindex">纸质书-亚马逊</a> <a href="/misc/goto?guid=4959746274842392689" rel="nofollow,noindex">电子书及源码</a></li> <li><a href="/misc/goto?guid=4959644957807037760" rel="nofollow,noindex">IOS设计模式探索(大话设计模式)</a></li> </ul> <p>设计模式 资源推荐</p> <ul> <li><a href="/misc/goto?guid=4959644957807037760" rel="nofollow,noindex">IOS设计模式探索(大话设计模式)</a></li> </ul> <p>Github上不错的资源,作者给出了大话设计模式 Objc 版的代码,底部推荐的 设计模式 4问答及 Cocoa设计如何设计模式也非常不错</p> <ul> <li><a href="/misc/goto?guid=4959653340360673105" rel="nofollow,noindex">史上最全设计模式导学目录(完整版)</a></li> </ul> <p>强烈推荐,推荐指数五颗星,刘伟老师力作,讲的非常好,通俗易懂,而且举例的应用场景也非常恰当,遗憾的是样例代码是 Java 写的,不过模式是通用的。</p> <ul> <li><a href="/misc/goto?guid=4959746274996917638" rel="nofollow,noindex">图说设计模式</a></li> </ul> <p>推荐指数4颗星,讲了不少UML的相关知识,能更好的理解设计模式中时序图等Mac下的UML工具推荐 StarUML ,做的也不错。</p> <p>伯乐在线-翻译Ray Wenderlich文章:</p> <ul> <li><a href="/misc/goto?guid=4959746275079798481" rel="nofollow,noindex">iOS设计模式之一:MVC模式和单例模式</a></li> <li><a href="/misc/goto?guid=4959746275157818836" rel="nofollow,noindex">iOS设计模式之二:外观模式和装饰器模式</a></li> <li><a href="/misc/goto?guid=4959746275249533696" rel="nofollow,noindex">iOS设计模式之三:适配器模式和观察者模式</a></li> <li><a href="/misc/goto?guid=4959746275324394321" rel="nofollow,noindex">iOS设计模式之四:备忘录模式和命令模式</a></li> <li><a href="/misc/goto?guid=4959550558291019022" rel="nofollow,noindex">iOS设计模式之观察者模式</a></li> <li><a href="/misc/goto?guid=4959746275442148469" rel="nofollow,noindex">iOS设计模式反思之单例模式的进化-非翻译</a></li> <li><a href="/misc/goto?guid=4959746275523852596" rel="nofollow,noindex">关于 23 种设计模式的有趣见解-非翻译</a></li> </ul> <p>####官网资料:</p> <ul> <li><a href="/misc/goto?guid=4959746275608440560" rel="nofollow,noindex">Cocoa Design Patterns</a></li> <li><a href="/misc/goto?guid=4959746275690212257" rel="nofollow,noindex">Cocoa Design Patterns 中文翻译下载地址</a></li> </ul> <p>InfoQ - iOS应用架构谈 - 推荐指数 5星</p> <ul> <li><a href="/misc/goto?guid=4958872058139374370" rel="nofollow,noindex">iOS应用架构谈(一):架构设计的方法论</a></li> <li><a href="/misc/goto?guid=4958873478469277361" rel="nofollow,noindex">iOS应用架构谈(二):View层的组织和调用方案</a></li> <li><a href="/misc/goto?guid=4958876440233155007" rel="nofollow,noindex">iOS应用架构谈(三):网络层设计方案</a></li> <li><a href="/misc/goto?guid=4959645393633830132" rel="nofollow,noindex">iOS应用架构谈(四):本地持久化方案及动态部署</a></li> </ul> <p>App 架构设计实践</p> <ul> <li><a href="/misc/goto?guid=4959746275902852813" rel="nofollow,noindex">饿了么移动APP的架构演进</a></li> <li><a href="/misc/goto?guid=4959746275985402256" rel="nofollow,noindex">滴滴iOS客户端的架构演变之路</a></li> <li><a href="https://mp.weixin.qq.com/s?__biz=MjM5MDE0Mjc4MA==&mid=403412672&idx=1&sn=2cceb873ee4640830aad3261ae177df5&scene=0&key=710a5d99946419d9ba63d1d480eb3f0c2d49be9d244f34e460226b2f4caaa02565fc4d16af8f64ca79085f4db276e89f&ascene=0&uin=MjY1NTg0NzMyMQ%3D%3D&devicetype=iMac+MacBookPro11%2C4+OSX+OSX+10.11.4+build(15E65)&version=11020201&pass_ticket=JxdNVNrS%2BerOsvJdjWQGHAqgDkV2%2FmL9OHAETsCT%2Bvp0%2B%2FLiXasOwpgYIsgQQn8O" rel="nofollow,noindex">携程移动App架构优化之旅</a> <a href="/misc/goto?guid=4959746276156129856" rel="nofollow,noindex">PPT</a></li> <li><a href="http://mp.weixin.qq.com/s?__biz=MzA3ODg4MDk0Ng==&mid=2651112273&idx=1&sn=893a66a04e541a99b7bc4d7cf227e2f7#rd" rel="nofollow,noindex">新浪微博iOS客户端架构与优化之路</a></li> <li><a href="http://mp.weixin.qq.com/s?__biz=MzA3ODg4MDk0Ng==&mid=2651112231&idx=1&sn=4578ff1009ee774093c45a3d8c19dd58#rd" rel="nofollow,noindex">Weex详解:移动端高性能动态化方案</a></li> <li><a href="/misc/goto?guid=4959746276408049078" rel="nofollow,noindex">覃超:非死book iOS App技术演化十年之路</a></li> </ul> <p>组件化设计 - casatwy VS Limboy</p> <ul> <li><a href="/misc/goto?guid=4959669532838643739" rel="nofollow,noindex">蘑菇街 App 的组件化之路</a></li> <li><a href="/misc/goto?guid=4959746276527694791" rel="nofollow,noindex">蘑菇街 App 的组件化之路·续</a></li> <li><a href="/misc/goto?guid=4959739633504452048" rel="nofollow,noindex">iOS应用架构谈(五):组件化方案</a></li> <li><a href="/misc/goto?guid=4959746276632269967" rel="nofollow,noindex">iOS 组件化方案探索</a></li> <li><a href="/misc/goto?guid=4959746276726170886" rel="nofollow,noindex">糯米移动组件架构演进之路</a></li> <li><a href="/misc/goto?guid=4959746276809697810" rel="nofollow,noindex">滴滴的组件化实践与优化</a></li> <li><a href="http://mp.weixin.qq.com/s?__biz=MzA3ODg4MDk0Ng==&mid=2651112821&idx=1&sn=2987ba2c9d68e3982e795d9eeb15f82b&chksm=844c6ca8b33be5be42e673ff2a9087628b0d9fab5e5a403d4bd346b134f4ffe110e423967c3e&scene=0#rd" rel="nofollow,noindex">豆瓣App的模块化实践</a></li> <li><a href="http://www.infoq.com/cn/articles/ios-app-component-development-practice?utm_source=articles_about_mobile&utm_medium=link&utm_campaign=mobile" rel="nofollow,noindex">iOS App组件化开发实践</a></li> </ul> <p>IM架构梳理</p> <ul> <li><a href="/misc/goto?guid=4959746277066734697" rel="nofollow,noindex">IM架构梳理</a></li> <li><a href="https://mp.weixin.qq.com/s?__biz=MzAwNjQwNzU2NQ==&mid=402441278&idx=1&sn=af82781e3e6b694d82ac8454dbe3ae67&scene=0&key=710a5d99946419d9ebeb6a76103f5b3c9a2a96d61dd040e7eaacca508005e842656a35d9b9664ec603be12ce0c3f25c7&ascene=0&uin=MjY1NTg0NzMyMQ%3D%3D&devicetype=iMac+MacBookPro11%2C4+OSX+OSX+10.11.3+build(15D21)&version=11020201&pass_ticket=TlXzGHRFhCo4eytB1hbIW0fFZq50RM%2BdZKQ7eajgE1C8Lc0aRV7IIgbSt6S4h5eZ" rel="nofollow,noindex">58到家消息系统设计与开发实践</a></li> <li><a href="https://mp.weixin.qq.com/s?__biz=MjM5ODYxMDA5OQ==&mid=205775353&idx=1&sn=ecc1f32ec9585f2c7672a27dfbc726ca&scene=1&srcid=0317WNL1c9K3dhx6rqsrhXL5&key=710a5d99946419d970963f96a056ab527d7e0a5ec70e2094cbb32922797076e77c9282e8ead417792c53ca5798beac51&ascene=0&uin=MjY1NTg0NzMyMQ%3D%3D&devicetype=iMac+MacBookPro11%2C4+OSX+OSX+10.11.3+build(15D21)&version=11020201&pass_ticket=TlXzGHRFhCo4eytB1hbIW0fFZq50RM%2BdZKQ7eajgE1C8Lc0aRV7IIgbSt6S4h5eZ" rel="nofollow,noindex">im协议设计选型(上)</a></li> <li><a href="https://mp.weixin.qq.com/s?__biz=MjM5ODYxMDA5OQ==&mid=205034544&idx=1&sn=26bbbf4a49ae6b6c4b8c3cba7f79764f&scene=1&srcid=0317zhrXNGEHs2T4xAjbCoeO&key=710a5d99946419d9f10782b19962c97c88912b052aadce02ef6e5d82a2b2814aa055d499a22072c468f7c1d3f085cc8a&ascene=0&uin=MjY1NTg0NzMyMQ%3D%3D&devicetype=iMac+MacBookPro11%2C4+OSX+OSX+10.11.3+build(15D21)&version=11020201&pass_ticket=TlXzGHRFhCo4eytB1hbIW0fFZq50RM%2BdZKQ7eajgE1C8Lc0aRV7IIgbSt6S4h5eZ" rel="nofollow,noindex">webim如何保证消息的可靠投递</a></li> <li><a href="https://mp.weixin.qq.com/s?__biz=MjM5ODYxMDA5OQ==&mid=205001346&idx=1&sn=fd87cc010bf4548589c9fabea80c4cad&scene=1&srcid=0317oohatukhxTbBwWHKP6cU&key=710a5d99946419d9708e602d966c3a50e34f09ca848c5b3bf380b79bc6b34ad6e84062ed43a22333531a6525cc8fa07d&ascene=0&uin=MjY1NTg0NzMyMQ%3D%3D&devicetype=iMac+MacBookPro11%2C4+OSX+OSX+10.11.3+build(15D21)&version=11020201&pass_ticket=TlXzGHRFhCo4eytB1hbIW0fFZq50RM%2BdZKQ7eajgE1C8Lc0aRV7IIgbSt6S4h5eZ" rel="nofollow,noindex">webim如何用轮询保证消息绝对实时</a></li> <li><a href="https://mp.weixin.qq.com/s?__biz=MjM5MzA0ODkyMA==&mid=405991976&idx=1&sn=4bf8982f2dc2ea2df62c312e4fe508f4&scene=0&key=710a5d99946419d98e3fd2dc46318f0db3ec6994c949bcf1ed7aa9792993c67eb1388d95f0019d30c30a407b14211064&ascene=0&uin=MjY1NTg0NzMyMQ%3D%3D&devicetype=iMac+MacBookPro11%2C4+OSX+OSX+10.11.3+build(15D21)&version=11020201&pass_ticket=TlXzGHRFhCo4eytB1hbIW0fFZq50RM%2BdZKQ7eajgE1C8Lc0aRV7IIgbSt6S4h5eZ" rel="nofollow,noindex">一套简洁的即时通信 (IM) 系统</a></li> <li><a href="https://mp.weixin.qq.com/s?__biz=MjM5ODYxMDA5OQ==&mid=205117508&idx=1&sn=71eecf04581e68deee4a44f7786309f5&scene=1&srcid=0317jpSQhhxbYvM2Kz6vlhOK&key=710a5d99946419d9c798c52d8b5dd4f67c1c4b144bb07217906e72260d353ac92559a0451d7548f74cc70ca9e0223637&ascene=0&uin=MjY1NTg0NzMyMQ%3D%3D&devicetype=iMac+MacBookPro11%2C4+OSX+OSX+10.11.3+build(15D21)&version=11020201&pass_ticket=TlXzGHRFhCo4eytB1hbIW0fFZq50RM%2BdZKQ7eajgE1C8Lc0aRV7IIgbSt6S4h5eZ" rel="nofollow,noindex">微博与im消息实现对比[随想]</a></li> </ul> <p>实战学习 最后推荐些可以帮助理解实战的开源项目:</p> <ul> <li><a href="/misc/goto?guid=4958968196504966453" rel="nofollow,noindex">V2EX - V2EX iOS客户端,已上线项目</a></li> <li><a href="/misc/goto?guid=4958856902533665789" rel="nofollow,noindex">Firox-IOS - Firox iOS客户端,用Swift写的</a></li> <li><a href="/misc/goto?guid=4959746277777063201" rel="nofollow,noindex">Telegram - 一个非常牛XXX的开源社交项目</a></li> <li><a href="/misc/goto?guid=4959746277854389571" rel="nofollow,noindex">网易云信开源UI组件</a></li> </ul> <p>其他资源:</p> <ul> <li><a href="/misc/goto?guid=4959746277950342867" rel="nofollow,noindex">objccn - 架构 - 强烈推荐</a></li> <li><a href="/misc/goto?guid=4959746278045010994" rel="nofollow,noindex">怎么面试架构师</a></li> <li><a href="/misc/goto?guid=4959629271378018318" rel="nofollow,noindex">EasyIOS</a></li> <li><a href="/misc/goto?guid=4959746278169744652" rel="nofollow,noindex">移动App架构设计</a></li> <li><a href="https://realm.io/cn/news/slug-marcus-zarra-exploring-mvcn-swift/?utm_source=tuicool&utm_medium=referral" rel="nofollow,noindex">探索 Swift 中的 MVC-N 模式</a></li> </ul> <p> </p> <p>来自:https://github.com/skyming/Trip-to-iOS-Design-Patterns</p> <p> </p>