?? Connected to the "Heat repair Jspatch Interface Design", in this article mainly to tell you how high-speed has the ability to repair heat, of course, if someone is interested in the Jspatch system of learning, and even with the development of Jspatch. There is no need to listen to me here to wordy.
Simple understanding of the Jspatch syntax
?? I'm just here to introduce some simple and often used.
1.Require need to call require before using the Objective-c class (' ClassName'): Require (' UIView') var view = Uiview.alloc (). Init () can import multiple classes at once, separated by commas, require (' UIView, Uicolor ') var view = Uiview.alloc (). Init () var red = Uicolor.redcolor () or call require () directly when used (): Require (' UIView'). Alloc (). Init ()2.Call the OC method call class method var Redcolor = Uicolor.redcolor (); Call instance method var view = Uiview.alloc (). Init (); View.setneedslayout (); The parameter pass passes the same number of references as in OC: var view = Uiview.alloc (). Init (); var superview = Uiview.alloc (). Init () Superview.addsubview (view) PropertyGet/change Propertyequals to call this PropertyMethod of Getter/setter. Remember to add (): View.setbackgroundcolor (Redcolor), var bgColor = View.backgroundcolor (); Method name conversion multi-parameter method name using _ Delimited: var Indexpath = Require' Nsindexpath'). Indexpathforrow_insection (0,1); Wakahara OC Method name includes underscore _, in JS using double underline __ Replace://obj-c: [Jpobject _privatemethod]; Jpobject.__privatemethod ()3.DEFINECLASSAPIQQQQ defineclass (classdeclaration, Instancemethods, Classmethods) @param classdeclaration: String, class name/ Parent class name and Protocol@param Instancemethods: instance method to join or overwrite @param Classmethods: Class method to join or overwrite
In the process of using the Discovery property name, method name to strictly according to the camel name, prohibit the use of the attribute name, or the middle of the method name ‘_‘
here to pay extra attention to Oh, the lesson of blood accumulated experience. Assume that you used the. can cause irreparable
If you want to see the full tutorial, you can click View
In the process of practice found that most people are not very familiar with the JS method, writing very slow, to find the conversion of the site conversion site address
Of course, after the conversion, we can not directly use, or with a lot of problems. For example, the macro definition can not be used, related method conversion error, JS syntax error, etc., we can use the following a site to do JS syntax check JS check URL
Through the above conversions. Check. We started trying to fix our bug locally. Assuming it can be repaired and tested, we are able to upload our hot fix script. Interested in the small partner can try Oh. Here is a little demo I wrote. Jspatch Repair Demo
A practical course of hot repair Jspatch