1. Preparatory work
As the project is getting bigger and larger, there are more and more documents. Many times when the merge code is in conflict with the project file, it can be difficult to modify if the. xcodeproj file conflict is opened.
So think of the modular program, and then go online to find information
Mushroom Street Small (There are demo, the house after the look after a simple point)
Roughly the same format as the URL scheme://host/path?query
1. When you start, register the corresponding URL host for the corresponding module name
2. How to use the route call URL directly when needed
2.CTMediator Overview (no sub-projects are currently generated, so the project is replaced by a folder)
2.1 Divided into three parts
Shell Engineering: Entrance to the entire program
Main project: Lib Library (Network tools, album tools, File Services, routing)
Sub-project: module Engineering
2.2 Ctmediator Working principle
1. + (instancetype) sharedinstance;
Routing Singleton objects
2.-(ID) Performactionwithurl: (nsurl *) URL completion: (void (^) (nsdictionary *info)) completion;
After the call can return a controller object, the format of the incoming URL such as Hgl://message/chat?key=value (message: From the module name, chat: The specific controller to point to)
3.-(ID) Performtarget: (NSString *) targetName action: (NSString *) actionname params: (nsdictionary *) params;
This method is faster than Method 2, which allows developers to understand [self performtarget:@ "message" action:@ "chat" params:@{@ "key": @ "value"}] more quickly.
4. All modules must have a routed receiver (ie, ingress)
4.1 Receiver class name target_ module name (Target can also be replaced by the words you like the definition of the word and then tell the others, others are good to follow this standard)
4.2 Method name inside Receiver-(Uiviewcontroller *) action_xx: (nsdictionary *) param; (XX stands for a controller)
A discussion on the component of IOS