MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / constructor

Method constructor

packages/core/image-asset/index.ios.ts:10–23  ·  view source on GitHub ↗
(asset: string | PHAsset | UIImage)

Source from the content-addressed store, hash-verified

8 private _ios: PHAsset;
9
10 constructor(asset: string | PHAsset | UIImage) {
11 super();
12 if (typeof asset === 'string') {
13 if (asset.indexOf('~/') === 0) {
14 asset = fsPath.join(knownFolders.currentApp().path, asset.replace('~/', ''));
15 }
16
17 this.nativeImage = UIImage.imageWithContentsOfFile(asset);
18 } else if (asset instanceof UIImage) {
19 this.nativeImage = asset;
20 } else {
21 this.ios = asset;
22 }
23 }
24
25 // @ts-ignore
26 get ios(): PHAsset {

Callers

nothing calls this directly

Calls 3

indexOfMethod · 0.80
joinMethod · 0.80
replaceMethod · 0.80

Tested by

no test coverage detected