MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / loadActionIcon

Function loadActionIcon

packages/core/ui/action-bar/index.ios.ts:22–44  ·  view source on GitHub ↗
(item: ActionItemDefinition)

Source from the content-addressed store, hash-verified

20}
21
22function loadActionIcon(item: ActionItemDefinition): any /* UIImage */ {
23 let is = null;
24 let img = null;
25
26 const itemIcon = item.icon;
27 const itemStyle = item.style;
28 if (isFontIconURI(itemIcon)) {
29 const fontIconCode = itemIcon.split('//')[1];
30 const font = itemStyle.fontInternal;
31 const color = itemStyle.color;
32 is = ImageSource.fromFontIconCodeSync(fontIconCode, font, color);
33 } else {
34 is = ImageSource.fromFileOrResourceSync(itemIcon);
35 }
36
37 if (is && is.ios) {
38 img = is.ios;
39 } else {
40 traceMissingIcon(itemIcon);
41 }
42
43 return img;
44}
45
46@NativeClass
47class TapBarItemHandlerImpl extends NSObject {

Callers 2

updateMethod · 0.85
createBarButtonItemMethod · 0.85

Calls 4

isFontIconURIFunction · 0.90
traceMissingIconFunction · 0.90
fromFontIconCodeSyncMethod · 0.45

Tested by

no test coverage detected