Last active
October 27, 2015 03:33
-
-
Save acegreen/05282d20eb45de8d30d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let script: JSValue = jsContext.objectForKeyedSubscript("getImageURL") | |
[jsContext callWithArguments:@["FirstParam",^(NSString* callbackValue) { | |
NSLog(@"Got a value: %@",callbackValue) | |
}] | |
basically I have a javascript function that looks like this: | |
function getImageURL(object, callback) { | |
object.executeActionById("takeScreenshot"); | |
object.onScreenshotReady(function(imageName) { | |
alert(imageName); | |
callback(imageName); | |
}); | |
}; | |
And all I really want is imageName on the iOS side. So I'm trying to call the callback part of it on iOS and get imageName. | |
onScreenshotReady is async so I need to wait for it to finish before I get my imageName. So I created a callback within it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @acegreen,
In addition to my first question, how can I create a method that will not generate an image on tradingview, but generating a base64 image and saving it to my local directory.
Thanks in advance..=