onmyway133 / notes

:notebook_with_decorative_cover: Issues and solutions I found during development, mostly iOS
https://onmyway133.com/
MIT License
62 stars 4 forks source link

Sketch plugin #197

Open onmyway133 opened 8 years ago

onmyway133 commented 8 years ago
onmyway133 commented 8 years ago
onmyway133 commented 8 years ago
onmyway133 commented 8 years ago

Load framework

var onRun = function(context) {
    var FRAMEWORK_NAME = "Instabar";
    try {
        SIInstabar.launchWithContext(context);
    } catch(e) {
        var pluginBundle = NSBundle.bundleWithURL(context.plugin.url()),
            mocha = Mocha.sharedRuntime();
        if(mocha.loadFrameworkWithName_inDirectory(FRAMEWORK_NAME, pluginBundle.resourceURL().path())) {
            SIInstabar.launchWithContext(context);
        } else {            
            print("Error while loading framework '"+FRAMEWORK_NAME+"`");
        }
    }
}