Commit 5592cffc authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

[ios] Switches to a block-based animation API in MemoryDebugger.

The previous non-block-based API dated back to iOS 3 and is deprecated
starting with iOS 13.

BUG=1086653

Change-Id: Id53e8f7e3b7938d056a38cc439733722179a3425
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2220485Reviewed-by: default avatarKurt Horimoto <kkhorimoto@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773291}
parent 9a20398a
......@@ -400,17 +400,19 @@ const CGFloat kPadding = 10;
// convert the UIKeyboardAnimationCurveUserInfoKey's value from a
// UIViewAnimationCurve to a UIViewAnimationOption. Awesome!
NSDictionary* userInfo = [notification userInfo];
[UIView beginAnimations:nil context:nullptr];
[UIView setAnimationDuration:
[userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue]];
NSInteger animationCurveKeyValue =
[userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue];
UIViewAnimationCurve animationCurve =
(UIViewAnimationCurve)animationCurveKeyValue;
[UIView setAnimationCurve:animationCurve];
[UIView setAnimationBeginsFromCurrentState:YES];
NSTimeInterval duration =
[userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue];
// The keyboard notification contains a UIViewAnimationCurve, but there is no
// function to convert that to UIViewAnimationOptions. Use the default
// instead, even if it doesn't exactly match the keyboard's curve.
[UIView animateWithDuration:duration
delay:0
options:UIViewAnimationOptionBeginFromCurrentState
animations:^{
self.frame = CGRectOffset(self.frame, offset.x, offset.y);
[UIView commitAnimations];
}
completion:nil];
}
#pragma mark Artificial memory bloat methods
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment