Skip to content

Add new property for Objective-c's Class without changing origin Class's code, support reflection, special for JSPatch

License

Notifications You must be signed in to change notification settings

wonderffee/DFDynamicProperty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DFDynamicProperty

Add new property for Objective-c's class without changing origin class's code, support reflection, special for JSPatch.

It's very helpful when you want to add a new property with JSPatch, to the iOS Project that integrate MJExtension or JSONModel.

A demo of JSPatch patch file:

require('DFDynamicProperty, NSString');

defineClass('ViewController', {
viewDidLoad: function() {
    DFDynamicProperty.addStringProperty_ForClass("markerImage", "SampleModel");
    DFDynamicProperty.addObjectProperty_ForClass_withPropertyClass("homeTeam", "SampleModel", "NSString");
    DFDynamicProperty.addCommonProperty_ForClass_withAttri_withPropertyClass_withCustomEncodeType("information", "SampleModel", "copy,nonatomic", NSString.class(), null);

    
    self.ORIGviewDidLoad();
    
    console.log("markerImage is " + self.modelData().markerImage().toJS());
    console.log("homeTeam is " + self.modelData().homeTeam().toJS());
    console.log("information is " + self.modelData().information().toJS());
},

});

About

Add new property for Objective-c's Class without changing origin Class's code, support reflection, special for JSPatch

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published