Hot Fixes and hot updates
1 hot update and hot fix: BUG of online fix program
2 Jspach Use principle: OC is a dynamic runtime language, the operation of methods and the creation of objects are created in the runtime. Jspatch is using the runtime, the javascriptcore.framework as the JS engine, from the JS dynamic call method and object to OC, then function nsinvocation dynamic call corresponding method.
Class class = Nsclassfromstring (@ "Uiviewcontroller");
ID controller = [class new];
SEL selector = nsselectorfromstring (@ "Viewdidload");
[Controller Performselector:selector];
3 Use steps
Drag the Jspatch folder into the file and drag the Dome.js file downloaded from GitHub into the project, in Appdelegate:
#import "AppDelegate.h"
#import "JPEngine.h"
#import "ViewController.h"
@interface Appdelegate ()
@end
@implementation Appdelegate
-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (Nsdictionary *) launchOptions {
[Jpengine StartEngine];
NSString *jspath = [[NSBundle mainbundle] pathforresource:@ "Demo.js" oftype:nil];
[Jpengine Evaluatescriptwithpath:jspath];
Self.window = [[UIWindow alloc] Initwithframe:[uiscreen mainscreen].bounds];
Viewcontroller *rootviewcontroller = [[Viewcontroller alloc] init];
Uinavigationcontroller *navigationcontroller = [[Uinavigationcontroller alloc] Initwithrootviewcontroller: Rootviewcontroller];
Self.window.rootViewController = Navigationcontroller;
[Self.window makekeyandvisible];
return YES;
}
@end
and implemented in VIEWCONTROLLER.M.
-(void) Viewdidload {
[Super Viewdidload];
UIButton *btn = [[UIButton alloc] Initwithframe:cgrectmake (0, + [UIScreen mainscreen].bounds.size.width, 50)];
[Btn settitle:@ "Push jptableviewcontroller" forstate:uicontrolstatenormal];
[Btn addtarget:self Action: @selector (HANDLEBTN:) forcontrolevents:uicontroleventtouchupinside];
[Btn Setbackgroundcolor:[uicolor Graycolor];
[Self.view ADDSUBVIEW:BTN];
}
-(void) HANDLEBTN: (UIButton *) btn {
}
Finally, change the Jsviewcontroller in Dome.js to Viewcontroller.
React Native
Literacy: is a technology that can simultaneously operate the front, back, and mobile to update the development in real time
Note: Create Javasript code by Javasript Runtime
The specific use of this article written very good link: https://zhuanlan.zhihu.com/p/19996445
Personal summary of heat update and heat recovery