forked from dzfweb/nativescript-emoji
-
Notifications
You must be signed in to change notification settings - Fork 0
/
emoji.ios.ts
34 lines (27 loc) · 845 Bytes
/
emoji.ios.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { nameProperty, EmojiCommon, sizeProperty } from "./emoji.common";
import { EmojiDatabase } from "./emoji.database";
global.moduleMerge(EmojiCommon, exports);
export class Emoji extends EmojiCommon {
[nameProperty.getDefault](): string {
return '';
}
[nameProperty.setNative](value: string) {
let emoji = EmojiDatabase.list().find((el) => el.shortname === value).unicode;
let nsString = NSString.stringWithString(emoji);
this.nativeView.text = nsString;
}
[sizeProperty.getDefault](): number {
return 10;
}
[sizeProperty.setNative](value: number) {
this.nativeView.font = UIFont.fontWithNameSize("HelveticaNeue", value);
}
private _ios: UILabel;
get ios() {
return this.nativeView;
}
public createNativeView() {
this._ios = UILabel.alloc().init();
return this._ios;
}
}