How codermikehe/mhdevelopexample_objective_c works
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: Classes Pattern Demos · Architecture WeChat Sample · MVC&MVVM MVC + MVVM · BaseClass Base Classes
Components 23
App Shell
Launch and top-level navigation into the demo catalog.
- AppDelegate · Starts the app and hands control to the root navigation structure.
MHDevelopExample/MHDevelopExample/AppDelegate.m - Root Screen · Primary catalog/entry controller that routes into sample modules.
MHDevelopExample/MHDevelopExample/MHRootViewController.m - Example List · 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 · Main teaching branch for MVC, MVVM, reactive use, comments, tables, and horizontal layouts.
MHDevelopExample/MHDevelopExample/Classes - MVC + MVVM · Goods/login examples showing plain MVC, MVVM without RAC, and MVVM with RAC.
MHDevelopExample/MHDevelopExample/Classes/MVC&MVVM - Goods Models · Shared goods, banner, and data wrapper models fed by bundled .data resources.
MHDevelopExample/MHDevelopExample/Classes/MVC&MVVM/Base/BaseModel - Goods 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 · View-model layer for login and goods flows, with and without RAC bindings.
MHDevelopExample/MHDevelopExample/Classes/MVC&MVVM/MVVMWithoutRAC/ViewModel - Comments Flow · Topic, comment, reply, and media-detail flows with frame models and manager logic.
MHDevelopExample/MHDevelopExample/Classes/Comment - Horizontal Layouts · Horizontally scrolling list and linkage examples with custom flow layout and multiple controllers.
MHDevelopExample/MHDevelopExample/Classes/Horizontal - Table Demos · Focused table-view behaviors such as operations, deletes, selection, and grouped-style quirks.
MHDevelopExample/MHDevelopExample/Classes/UITableView - RAC Basics · 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 · Second architecture stratum organized like a multi-tab, app-like feature set.
MHDevelopExample/MHDevelopExample/Architecture - Home Page · Entry feature for the architecture sample app.
MHDevelopExample/MHDevelopExample/Architecture/HomePage/HomePage/CMHHomePageViewController.m - Main Frame · Tab/root frame and related transition examples.
MHDevelopExample/MHDevelopExample/Architecture/MainFrame/MainFrame/CMHMainFrameViewController.m - Contacts · Contacts-side module containing file upload and live-room related examples.
MHDevelopExample/MHDevelopExample/Architecture/Contacts/Contacts/CMHContactsViewController.m - Discover · Discovery/search/waterfall/card examples with collection-style UI.
MHDevelopExample/MHDevelopExample/Architecture/Discover/Discover/CMHDiscoverViewController.m - Profile · Profile module and its example screen.
MHDevelopExample/MHDevelopExample/Architecture/Profile/Profile/CMHProfileViewController.m - File Upload · 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 · Cross-cutting services, managers, helpers, protocols, and reusable UI support.
MHDevelopExample/MHDevelopExample/Architecture/Utils - Base Classes · Shared model/view/controller primitives for the architecture sample app.
MHDevelopExample/MHDevelopExample/Architecture/BaseClass - UIKit Categories · 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 · Bundled third-party code such as ReactiveCocoa, YYKit, MBProgressHUD, and paging/scroll helpers.
MHDevelopExample/MHDevelopExample/Classes/Main/Libs
Connections 27
- 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.