Skip to content

Commit 5c7edd8

Browse files
authored
feat(ios): view rotation parity (#13946)
* feat(ios): view rotation parity * docs
1 parent 8fde8c2 commit 5c7edd8

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

apidoc/Titanium/UI/View.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,8 +1810,8 @@ properties:
18101810
summary: Clockwise 2D rotation of the view in degrees.
18111811
description: Translation values are applied to the static post layout value.
18121812
type: Number
1813-
platforms: [android]
1814-
since: 5.4.0
1813+
platforms: [android, iphone, ipad]
1814+
since: {android: "5.4.0", iphone: "12.3.0", ipad: "12.3.0"}
18151815

18161816
- name: rotationX
18171817
summary: Clockwise rotation of the view in degrees (x-axis).

iphone/TitaniumKit/TitaniumKit/Sources/API/TiViewProxy.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ enum {
242242
- (id)animatedCenter;
243243

244244
- (void)setBackgroundGradient:(id)arg;
245+
- (void)setRotation:(id)arg;
245246
- (TiBlob *)toImage:(id)args;
246247
- (TiPoint *)contentOffset;
247248

iphone/TitaniumKit/TitaniumKit/Sources/API/TiViewProxy.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,12 @@ - (void)setBackgroundGradient:(id)arg
670670
[self replaceValue:newGradient forKey:@"backgroundGradient" notification:YES];
671671
}
672672

673+
- (void)setRotation:(id)arg
674+
{
675+
float val = ([TiUtils intValue:arg] * M_PI) / 180.0;
676+
[self view].transform = CGAffineTransformMakeRotation(val);
677+
}
678+
673679
- (TiBlob *)toImage:(id)args
674680
{
675681
KrollCallback *callback = nil;

0 commit comments

Comments
 (0)