mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-20 07:26:11 +08:00
Merge branch 'master' of github.com:NativeScript/NativeScript
This commit is contained in:
@ -154,8 +154,13 @@ export class ImageSource implements ImageSourceDefinition {
|
||||
return new Promise<ImageSource>((resolve, reject) => {
|
||||
try {
|
||||
const data = NSData.alloc().initWithBase64EncodedStringOptions(source, NSDataBase64DecodingOptions.IgnoreUnknownCharacters);
|
||||
UIImage.imageWithData['async'](UIImage, [data]).then((uiImage) => {
|
||||
resolve(new ImageSource(uiImage));
|
||||
const main_queue = dispatch_get_current_queue();
|
||||
const background_queue = dispatch_get_global_queue(qos_class_t.QOS_CLASS_DEFAULT, 0);
|
||||
dispatch_async(background_queue, () => {
|
||||
const uiImage = UIImage.imageWithData(data);
|
||||
dispatch_async(main_queue, () => {
|
||||
resolve(new ImageSource(uiImage));
|
||||
});
|
||||
});
|
||||
} catch (ex) {
|
||||
reject(ex);
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
"main": "index",
|
||||
"types": "index.d.ts",
|
||||
"description": "NativeScript Core Modules",
|
||||
"version": "7.0.12",
|
||||
"version": "7.0.13",
|
||||
"homepage": "https://nativescript.org",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
Reference in New Issue
Block a user