(asset: string | PHAsset | UIImage)
| 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 { |