Skip to content

Commit

Permalink
feat(ios): view rotation parity (#13946)
Browse files Browse the repository at this point in the history
* feat(ios): view rotation parity

* docs
  • Loading branch information
m1ga authored Jan 10, 2024
1 parent 8fde8c2 commit 5c7edd8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apidoc/Titanium/UI/View.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1810,8 +1810,8 @@ properties:
summary: Clockwise 2D rotation of the view in degrees.
description: Translation values are applied to the static post layout value.
type: Number
platforms: [android]
since: 5.4.0
platforms: [android, iphone, ipad]
since: {android: "5.4.0", iphone: "12.3.0", ipad: "12.3.0"}

- name: rotationX
summary: Clockwise rotation of the view in degrees (x-axis).
Expand Down
1 change: 1 addition & 0 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/TiViewProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ enum {
- (id)animatedCenter;

- (void)setBackgroundGradient:(id)arg;
- (void)setRotation:(id)arg;
- (TiBlob *)toImage:(id)args;
- (TiPoint *)contentOffset;

Expand Down
6 changes: 6 additions & 0 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/TiViewProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,12 @@ - (void)setBackgroundGradient:(id)arg
[self replaceValue:newGradient forKey:@"backgroundGradient" notification:YES];
}

- (void)setRotation:(id)arg
{
float val = ([TiUtils intValue:arg] * M_PI) / 180.0;
[self view].transform = CGAffineTransformMakeRotation(val);
}

- (TiBlob *)toImage:(id)args
{
KrollCallback *callback = nil;
Expand Down

0 comments on commit 5c7edd8

Please sign in to comment.