Skip to content

Commit 91c42bc

Browse files
authored
chore(switch): ios impl of onBackgroundColor
1 parent c456a6b commit 91c42bc

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/switch/index.ios.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
import { SwitchBase } from './index-common';
1+
import { SwitchBase, onBackgroundColorProperty } from './index-common';
22

33
// TODO: for now iOS uses system switch
4-
export class Switch extends SwitchBase {}
4+
export class Switch extends SwitchBase {
5+
6+
[onBackgroundColorProperty.setNative](value) {
7+
if (value) {
8+
this.nativeViewProtected.onTintColor = value instanceof Color ? value.ios : value;
9+
}
10+
else {
11+
this.nativeViewProtected.onTintColor = null;
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)