-
Notifications
You must be signed in to change notification settings - Fork 121
How it Works
There's three main parts in DYCI
- Clang-proxy compiler
- Plugin-based compiler
- Dynamic library compiler
- iOS Dyci Library
At installation phase, your clang compiler will be switched to the "fake" one. Main purpose of this clang-proxy compiler is to save parameters for each file that was compiled. After save, it calls real clang.
(Note: This part is about to change, because we don't think that proxying clang is the best idea. In next version we are going to perform this task without clang-proxy)
** OR **
Plugin based compiler (Xcode only since 1.6.0)
At installation phase your clang compiler will remain untouched. (use ./install.sh -s
)
In order to search compilation parameters for each file, Plugin is using Xcode runtime.
When you are executing "Recompile and Inject" from Xcode, dyci working in this way:
- Recompiles your selected file class X, with parameters that was saved earlier by clang-proxy.
- After successful compilation, object file that was received after compilation, is wrapped to dynamic library (dylib)
- This dylib file is placed to user home directory (~/.dyci)
###iOS Dyci Library
- On iOS Simulator side, iOS dyci Library are watching for changes in (~/.dyci)
- When new file appeared, it loads new dylib with dlopen function
- If all went OK, then at current moment we have 2 (or more) instances of class X.
- dicy Library changing all methods of your current class with the new implementations
Additionaly, if instances of class X has declared
-(void)updateOnClassInjection
method, then this method called for each instance
When all three parts succeded, you save some amount of time.