Home
zteshadow
Cancel

MVC, MVP, MVVM, VIPER and MVVMC(SwiftUI) All In One

Architecture iOS开发最初遵循原始的MVC架构, 但是随着业务的演进代码越来越复杂, 很容易变成Massive View Controller, 最终导致代码难以维护, 难以测试, 难以复用. 为了解决这个问题逐步演化出: MVP MVVM VIPER MVVM-C 等架构. 今天我们就用各个架构实现一个ToDoList来看看他们是如何解决问题的以及各自...

Best Practice iOS Part3 - Dependency injection

Why we need dependency injection 1. Dependency Dependency is the connection between modules, take BookList module for example, it needs lots of services, such as: Network for data retrieving ...

Best Practice iOS Part2 - Modules

How to divide modules Modules can be divided by different perspective, and usually there are two different perspectives: function and business, from the functional perspective, Network, Dependency...

Best Practice iOS Part1 - Start

Best practice - artistry I’ve been a software engineer for more than 16 years, have been using C, C++, Objective-C, Swift lauguage and have built lots of products such as USB driver on digital wir...

Main Entry For iOS Application

我们知道所有程序的主入口是main函数, 这个概念在C语言里面的实现简单而直接. int main(int argc, char **argv) { printf("hello world\n"); return 0; } 对于一个与用户交互的应用程序, 初始化之后通常会构造交互界面(比如CLI会接受用户输入), 然后进入事件循环处理各种用户事件, 系统事件, 伪代码如下....

RadioGroup Picker for iOS

1. 当前的SwiftUI Picker SwiftUI提供了一个Picker控件用来进行选择操作, 目前支持segmented, inline, wheel, menu四种种样式, 接口简单, 使用方便, 效果也不错. 接口: struct Picker<Label, SelectionValue, Content> : View where Label : Vi...

Hello World

Hello world! This is my first post, and also the start of the rest of my life:) Hi, 这是我的第一篇blog, 好好生活, 学习和思考!