# codermikehe/mhdevelopexample_objective_c architecture

> Architecture diagram of the GitHub repository codermikehe/mhdevelopexample_objective_c, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/codermikehe/mhdevelopexample_objective_c
- Repository: https://github.com/codermikehe/mhdevelopexample_objective_c

## Overview

1. This repository is an Objective-C iOS demo suite, not a single product app. It bundles many isolated architecture examples and UI patterns into one Xcode project, with the app acting as a launcher/catalog for those demos.

2. The app shell is thin: `AppDelegate` boots into a root/navigation structure centered around `MHRootViewController` and example controllers such as `MHExampleController`. From there, users navigate into the different sample modules. The navigation layer is standardized with custom navigation controllers and, in some areas, tab bar controllers.

3. There are two major code strata. `Classes/` contains the main teaching/demonstration implementations for MVC, MVVM, reactive programming, table views, comments, horizontal layouts, and “paternity” style controller hierarchies. `Architecture/` contains a second, more app-like feature set with a WeChat-style module split into HomePage, MainFrame, Contacts, Discover, Profile, and supporting infrastructure.

4. Shared foundation code is centralized in base classes, categories, constants, and macros. These define reusable view/controller/model primitives, standard UI controls, layout helpers, and utility categories on UIKit/Foundation types. This layer is the common boundary used by most feature modules so each example can stay focused on the pattern being demonstrated.

5. The MVC/MVVM examples form one of the clearest architectural branches. Local `.data` files under `Classes/MVC&MVVM/Other/Resource/Data` feed model objects like `SUGoods`, `SUBanner`, and related data wrappers. Those models then flow into either plain MVC controllers, MVVM without RAC, or MVVM with RAC via corresponding view models and view controllers. The “with RAC” variants add reactive binding through `ReactiveCocoa`.

6. The `Architecture/Contacts`, `Architecture/Discover`, `Architecture/MainFrame`, and `Architecture/Profile` areas are organized like feature slices. Each slice contains its own controllers, cells, and sometimes model/view subfolders, which makes each sample diagrammable as a self-contained module rather than a shared mega-UI.

7. Several submodules model more complex interaction patterns. The comments-related code builds topic/comment/reply flows with frame models and manager objects; the YouKu branch adds media detail, anthology, input panels, and toolbars; the horizontal branch explores horizontally scrolling lists, grouped layouts, and linkage between multiple controllers. These are mostly controller-driven UI flows with lightweight models.

8. File upload is one of the few areas with a stronger service/manager split. `Architecture/Contacts/FileUpload` separates controllers, a dedicated upload manager, upload queue/block/fragment/source models, and upload-related views. This is the clearest example of a pipeline-like subsystem where UI triggers work, the manager coordinates state, and the models represent upload structure and progress.

9. Utility layers provide the cross-cutting services that support the demos. Notable pieces include an HTTP service/request/response abstraction, file manager helpers, cache/keychain helpers, keyboard dismissal/HUD categories, refresh controls for scroll views, and empty-state view support. These are the main “infrastructure” boundaries that keep feature code from directly depending on low-level UIKit or persistence details.

10. Third-party libraries are embedded through CocoaPods and vendored source. The repo includes and/or wraps tools such as ReactiveCocoa, YYKit, MBProgressHUD, SDCycleScrollView, ICViewPager, RegexKitLite, FBKVOController, and keychain/cache helpers. They materially affect the architecture by enabling reactive binding, paging, refresh/loading behavior, and utility services without custom reimplementation.

11. Resources are heavily feature-scoped. Asset catalogs are grouped by domain such as TabBar, Navigation, Comment, FileUpload, Goods, WeChat, and Placeholder, while many reusable views are backed by XIBs. That makes the visual layer mostly declarative and reusable across the example modules.

12. Overall data flow is mostly local and in-process: app shell -> selected demo controller -> optional view model/manager -> model/data file or utility service -> custom cell/view rendering. There is no visible standalone backend service in the repository; external dependencies are primarily framework and library level, while the “data” for many demos comes from bundled files and assets.

Main entry points: [`MHDevelopExample/MHDevelopExample/Classes`](https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes) (Pattern Demos), [`MHDevelopExample/MHDevelopExample/Architecture`](https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Architecture) (WeChat Sample), [`MHDevelopExample/MHDevelopExample/Classes/MVC&MVVM`](https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes/MVC&MVVM) (MVC + MVVM), [`MHDevelopExample/MHDevelopExample/Architecture/BaseClass`](https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Architecture/BaseClass) (Base Classes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["App Shell"]
  node_app_delegate["AppDelegate<br/>app bootstrap<br/>[AppDelegate.m]"]
  node_root_vc["Root Screen<br/>launcher root"]
  node_example_controller["Example List<br/>demo launcher"]
end

subgraph group_classes["Classes Demos"]
  node_classes_main["Pattern Demos<br/>demo suite"]
  node_mvc_mvvm["MVC + MVVM<br/>architecture examples"]
  node_mvc_models[("Goods Models<br/>data models")]
  node_mvc_views["Goods Views<br/>ui views"]
  node_mvc_vms["View Models<br/>presentation models"]
  node_comments["Comments Flow<br/>topic/comment UI"]
  node_horizontal["Horizontal Layouts<br/>scroll/layout demos"]
  node_table_demos["Table Demos<br/>table view patterns"]
  node_rac_demo["RAC Basics<br/>reactive demo"]
end

subgraph group_arch["Architecture App"]
  node_arch_main["WeChat Sample<br/>feature-sliced app"]
  node_home_page["Home Page<br/>feature slice"]
  node_main_frame["Main Frame<br/>tab module"]
  node_contacts["Contacts<br/>feature slice"]
  node_discover["Discover<br/>feature slice"]
  node_profile["Profile<br/>feature slice"]
  node_file_upload[("File Upload<br/>pipeline module")]
end

subgraph group_foundation["Shared Foundation"]
  node_shared_utils["Shared Utils<br/>infrastructure layer"]
  node_shared_base["Base Classes<br/>foundation layer"]
  node_main_categories["UIKit Categories<br/>extensions"]
end

subgraph group_thirdparty["Third Party"]
  node_main_libs["Embedded Libs<br/>vendored libraries"]
end

node_app_delegate -->|"boots"| node_root_vc
node_root_vc -->|"launches"| node_example_controller
node_example_controller -->|"opens"| node_classes_main
node_example_controller -->|"opens"| node_arch_main
node_classes_main -->|"includes"| node_mvc_mvvm
node_mvc_mvvm -->|"loads"| node_mvc_models
node_mvc_mvvm -->|"renders"| node_mvc_views
node_mvc_mvvm -->|"adapts"| node_mvc_vms
node_mvc_vms -->|"binds via RAC"| node_main_libs
node_classes_main -->|"includes"| node_comments
node_comments -->|"reuses"| node_shared_base
node_classes_main -->|"includes"| node_horizontal
node_classes_main -->|"includes"| node_table_demos
node_classes_main -->|"includes"| node_rac_demo
node_arch_main -->|"contains"| node_home_page
node_arch_main -->|"contains"| node_main_frame
node_arch_main -->|"contains"| node_contacts
node_arch_main -->|"contains"| node_discover
node_arch_main -->|"contains"| node_profile
node_contacts -->|"navigates to"| node_file_upload
node_file_upload -->|"orchestrates with"| node_shared_utils
node_contacts -->|"extends"| node_shared_base
node_discover -->|"extends"| node_shared_base
node_main_frame -->|"uses"| node_shared_utils
node_shared_utils -->|"augmented by"| node_main_categories
node_shared_base -->|"relies on"| node_main_categories
node_main_categories -->|"wraps"| node_main_libs

click node_app_delegate "https://github.com/codermikehe/mhdevelopexample_objective_c/blob/master/MHDevelopExample/MHDevelopExample/AppDelegate.m"
click node_root_vc "https://github.com/codermikehe/mhdevelopexample_objective_c/blob/master/MHDevelopExample/MHDevelopExample/MHRootViewController.m"
click node_example_controller "https://github.com/codermikehe/mhdevelopexample_objective_c/blob/master/MHDevelopExample/MHDevelopExample/Classes/MHExampleController.m"
click node_classes_main "https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes"
click node_mvc_mvvm "https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes/MVC&MVVM"
click node_mvc_models "https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes/MVC&MVVM/Base/BaseModel"
click node_mvc_views "https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes/MVC&MVVM/Base/BaseView"
click node_mvc_vms "https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes/MVC&MVVM/MVVMWithoutRAC/ViewModel"
click node_comments "https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes/Comment"
click node_horizontal "https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes/Horizontal"
click node_table_demos "https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes/UITableView"
click node_rac_demo "https://github.com/codermikehe/mhdevelopexample_objective_c/blob/master/MHDevelopExample/MHDevelopExample/Classes/ReactiveCocoa/RACBasicUse/RACBasicUseController.m"
click node_arch_main "https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Architecture"
click node_home_page "https://github.com/codermikehe/mhdevelopexample_objective_c/blob/master/MHDevelopExample/MHDevelopExample/Architecture/HomePage/HomePage/CMHHomePageViewController.m"
click node_main_frame "https://github.com/codermikehe/mhdevelopexample_objective_c/blob/master/MHDevelopExample/MHDevelopExample/Architecture/MainFrame/MainFrame/CMHMainFrameViewController.m"
click node_contacts "https://github.com/codermikehe/mhdevelopexample_objective_c/blob/master/MHDevelopExample/MHDevelopExample/Architecture/Contacts/Contacts/CMHContactsViewController.m"
click node_discover "https://github.com/codermikehe/mhdevelopexample_objective_c/blob/master/MHDevelopExample/MHDevelopExample/Architecture/Discover/Discover/CMHDiscoverViewController.m"
click node_profile "https://github.com/codermikehe/mhdevelopexample_objective_c/blob/master/MHDevelopExample/MHDevelopExample/Architecture/Profile/Profile/CMHProfileViewController.m"
click node_file_upload "https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Architecture/Contacts/FileUpload"
click node_shared_utils "https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Architecture/Utils"
click node_shared_base "https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Architecture/BaseClass"
click node_main_categories "https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes/Main/Category"
click node_main_libs "https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes/Main/Libs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_delegate,node_root_vc,node_example_controller toneBlue
class node_classes_main,node_mvc_mvvm,node_mvc_models,node_mvc_views,node_mvc_vms,node_comments,node_horizontal,node_table_demos,node_rac_demo toneAmber
class node_arch_main,node_home_page,node_main_frame,node_contacts,node_discover,node_profile,node_file_upload toneMint
class node_shared_utils,node_shared_base,node_main_categories toneRose
class node_main_libs toneIndigo
```

## Components

### App Shell

Launch and top-level navigation into the demo catalog.

- [AppDelegate](https://github.com/codermikehe/mhdevelopexample_objective_c/blob/master/MHDevelopExample/MHDevelopExample/AppDelegate.m): app bootstrap · Starts the app and hands control to the root navigation structure. · `MHDevelopExample/MHDevelopExample/AppDelegate.m`
- [Root Screen](https://github.com/codermikehe/mhdevelopexample_objective_c/blob/master/MHDevelopExample/MHDevelopExample/MHRootViewController.m): launcher root · Primary catalog/entry controller that routes into sample modules. · `MHDevelopExample/MHDevelopExample/MHRootViewController.m`
- [Example List](https://github.com/codermikehe/mhdevelopexample_objective_c/blob/master/MHDevelopExample/MHDevelopExample/Classes/MHExampleController.m): demo launcher · Lists the available demonstrations and sample entry points. · `MHDevelopExample/MHDevelopExample/Classes/MHExampleController.m`

### Classes Demos

Teaching modules for MVC, MVVM, tables, comments, horizontal layouts, reactive use, and controller hierarchy patterns.

- [Pattern Demos](https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes): demo suite · Main teaching branch for MVC, MVVM, reactive use, comments, tables, and horizontal layouts. · `MHDevelopExample/MHDevelopExample/Classes`
- [MVC + MVVM](https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes/MVC&MVVM): architecture examples · Goods/login examples showing plain MVC, MVVM without RAC, and MVVM with RAC. · `MHDevelopExample/MHDevelopExample/Classes/MVC&MVVM`
- [Goods Models](https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes/MVC&MVVM/Base/BaseModel): data models · Shared goods, banner, and data wrapper models fed by bundled .data resources. · `MHDevelopExample/MHDevelopExample/Classes/MVC&MVVM/Base/BaseModel`
- [Goods Views](https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes/MVC&MVVM/Base/BaseView): ui views · Reusable cells, headers, image views, and login/search views used by MVC and MVVM samples. · `MHDevelopExample/MHDevelopExample/Classes/MVC&MVVM/Base/BaseView`
- [View Models](https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes/MVC&MVVM/MVVMWithoutRAC/ViewModel): presentation models · View-model layer for login and goods flows, with and without RAC bindings. · `MHDevelopExample/MHDevelopExample/Classes/MVC&MVVM/MVVMWithoutRAC/ViewModel`
- [Comments Flow](https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes/Comment): topic/comment UI · Topic, comment, reply, and media-detail flows with frame models and manager logic. · `MHDevelopExample/MHDevelopExample/Classes/Comment`
- [Horizontal Layouts](https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes/Horizontal): scroll/layout demos · Horizontally scrolling list and linkage examples with custom flow layout and multiple controllers. · `MHDevelopExample/MHDevelopExample/Classes/Horizontal`
- [Table Demos](https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes/UITableView): table view patterns · Focused table-view behaviors such as operations, deletes, selection, and grouped-style quirks. · `MHDevelopExample/MHDevelopExample/Classes/UITableView`
- [RAC Basics](https://github.com/codermikehe/mhdevelopexample_objective_c/blob/master/MHDevelopExample/MHDevelopExample/Classes/ReactiveCocoa/RACBasicUse/RACBasicUseController.m): reactive demo · Standalone ReactiveCocoa usage example. · `MHDevelopExample/MHDevelopExample/Classes/ReactiveCocoa/RACBasicUse/RACBasicUseController.m`

### Architecture App

A WeChat-style feature-sliced sample app with multiple coordinated sections.

- [WeChat Sample](https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Architecture): feature-sliced app · Second architecture stratum organized like a multi-tab, app-like feature set. · `MHDevelopExample/MHDevelopExample/Architecture`
- [Home Page](https://github.com/codermikehe/mhdevelopexample_objective_c/blob/master/MHDevelopExample/MHDevelopExample/Architecture/HomePage/HomePage/CMHHomePageViewController.m): feature slice · Entry feature for the architecture sample app. · `MHDevelopExample/MHDevelopExample/Architecture/HomePage/HomePage/CMHHomePageViewController.m`
- [Main Frame](https://github.com/codermikehe/mhdevelopexample_objective_c/blob/master/MHDevelopExample/MHDevelopExample/Architecture/MainFrame/MainFrame/CMHMainFrameViewController.m): tab module · Tab/root frame and related transition examples. · `MHDevelopExample/MHDevelopExample/Architecture/MainFrame/MainFrame/CMHMainFrameViewController.m`
- [Contacts](https://github.com/codermikehe/mhdevelopexample_objective_c/blob/master/MHDevelopExample/MHDevelopExample/Architecture/Contacts/Contacts/CMHContactsViewController.m): feature slice · Contacts-side module containing file upload and live-room related examples. · `MHDevelopExample/MHDevelopExample/Architecture/Contacts/Contacts/CMHContactsViewController.m`
- [Discover](https://github.com/codermikehe/mhdevelopexample_objective_c/blob/master/MHDevelopExample/MHDevelopExample/Architecture/Discover/Discover/CMHDiscoverViewController.m): feature slice · Discovery/search/waterfall/card examples with collection-style UI. · `MHDevelopExample/MHDevelopExample/Architecture/Discover/Discover/CMHDiscoverViewController.m`
- [Profile](https://github.com/codermikehe/mhdevelopexample_objective_c/blob/master/MHDevelopExample/MHDevelopExample/Architecture/Profile/Profile/CMHProfileViewController.m): feature slice · Profile module and its example screen. · `MHDevelopExample/MHDevelopExample/Architecture/Profile/Profile/CMHProfileViewController.m`
- [File Upload](https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Architecture/Contacts/FileUpload): pipeline module · UI-driven upload subsystem with manager, queue, block, fragment, and source models. · `MHDevelopExample/MHDevelopExample/Architecture/Contacts/FileUpload`

### Shared Foundation

Reusable base classes, categories, constants, services, and utilities used across demos.

- [Shared Utils](https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Architecture/Utils): infrastructure layer · Cross-cutting services, managers, helpers, protocols, and reusable UI support. · `MHDevelopExample/MHDevelopExample/Architecture/Utils`
- [Base Classes](https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Architecture/BaseClass): foundation layer · Shared model/view/controller primitives for the architecture sample app. · `MHDevelopExample/MHDevelopExample/Architecture/BaseClass`
- [UIKit Categories](https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes/Main/Category): extensions · Common Objective-C categories for UIKit/Foundation behavior and app conveniences. · `MHDevelopExample/MHDevelopExample/Classes/Main/Category`

### Third Party

Embedded libraries and vendored components that support reactive, UI, and utility behavior.

- [Embedded Libs](https://github.com/codermikehe/mhdevelopexample_objective_c/tree/master/MHDevelopExample/MHDevelopExample/Classes/Main/Libs): vendored libraries · Bundled third-party code such as ReactiveCocoa, YYKit, MBProgressHUD, and paging/scroll helpers. · `MHDevelopExample/MHDevelopExample/Classes/Main/Libs`

## Connections

- AppDelegate → Root Screen: boots · Application startup creates the root navigation flow.
- Root Screen → Example List: launches · Root shell hands navigation to the demo catalog.
- Example List → Pattern Demos: opens · Catalog routes into the main demo suite.
- Example List → WeChat Sample: opens · Catalog routes into the architecture sample app.
- Pattern Demos → MVC + MVVM: includes · Main demo branch includes the MVC/MVVM teaching path.
- MVC + MVVM → Goods Models: loads · Local bundled data and model wrappers feed the goods flows.
- MVC + MVVM → Goods Views: renders · Controllers bind data into reusable cells and views.
- MVC + MVVM → View Models: adapts · MVVM variants route state through view models.
- View Models → Embedded Libs: binds via RAC · RAC-backed variants rely on embedded reactive libraries.
- Pattern Demos → Comments Flow: includes · Comment and media-detail patterns live in a dedicated branch.
- Comments Flow → Base Classes: reuses · Comment flows extend shared controller/view primitives.
- Pattern Demos → Horizontal Layouts: includes · Horizontal list and linkage experiments live in their own module.
- Pattern Demos → Table Demos: includes · Table view behavior demos are separated as another branch.
- Pattern Demos → RAC Basics: includes · Standalone reactive programming example.
- WeChat Sample → Home Page: contains · Architecture sample starts from the home page slice.
- WeChat Sample → Main Frame: contains · Main frame slice provides the tab/root container.
- WeChat Sample → Contacts: contains · Contacts slice holds contacts-side examples.
- WeChat Sample → Discover: contains · Discover slice holds discovery/search examples.
- WeChat Sample → Profile: contains · Profile slice holds profile-related examples.
- Contacts → File Upload: navigates to · Contacts module exposes the upload pipeline subsystem.
- File Upload → Shared Utils: orchestrates with · Upload manager and UI use shared HTTP/file/helper infrastructure.
- Contacts → Base Classes: extends · Contacts feature slices build on common base classes.
- Discover → Base Classes: extends · Discover feature slices also reuse common base classes.
- Main Frame → Shared Utils: uses · Tab/root and transition behavior depend on shared utilities.
- Shared Utils → UIKit Categories: augmented by · Utilities are reinforced by UIKit/Foundation categories in the main layer.
- Base Classes → UIKit Categories: relies on · Shared base components use common categories and helpers.
- UIKit Categories → Embedded Libs: wraps · Categories often wrap or extend vendored helper libraries.
