0
我找不到任何地方使用resetTopViewWithAnimations的例子。示例應用程序不使用動畫,並且我見過的每個論壇都沒有提及如何使用此方法實際實現動畫。有人可以解釋我將如何實現基本的反彈效果(視圖重置爲居中然後反彈幾次)?ECSlidingViewController動畫實現彈跳效果
https://github.com/edgecase/ECSlidingViewController
- (void)resetTopViewWithAnimations:(void(^)())animations onComplete:(void(^)())complete
{
[self topViewHorizontalCenterWillChange:self.resettedCenter];
[UIView animateWithDuration:0.25f animations:^{
if (animations) {
animations();
}
[self updateTopViewHorizontalCenter:self.resettedCenter];
} completion:^(BOOL finished) {
if (complete) {
complete();
}
[self topViewHorizontalCenterDidChange:self.resettedCenter];
}];
}