Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ios): view rotation parity #13946

Merged
merged 2 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading