Welcome to mirror list, hosted at ThFree Co, Russian Federation.

MWMPlacePage+Animation.mm « Classes « Maps « iphone - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1c50a6ed8e97c903a50b4c191faed7a031ffd30f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#import "MWMPlacePage+Animation.h"
#import "MWMPlacePageViewManager.h"
#import <objc/runtime.h>

@implementation MWMPlacePage (Animation)

- (void)setSpringAnimation:(MWMSpringAnimation *)springAnimation
{
  objc_setAssociatedObject(self, @selector(springAnimation), springAnimation, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

- (MWMSpringAnimation *)springAnimation
{
  return objc_getAssociatedObject(self, @selector(springAnimation));
}

- (CGPoint)targetPoint
{
  [self doesNotRecognizeSelector:_cmd];
  return CGPointZero;
}

- (void)cancelSpringAnimation
{
  [self.manager.ownerViewController.view.animator removeAnimation:self.springAnimation];
  self.springAnimation = nil;
}

- (void)startAnimatingPlacePage:(MWMPlacePage *)placePage initialVelocity:(CGPoint)velocity completion:(MWMSpringAnimationCompletionBlock)completion
{
  [self cancelSpringAnimation];
  self.springAnimation = [MWMSpringAnimation animationWithView:placePage.extendedPlacePageView target:placePage.targetPoint velocity:velocity completion:completion];
  [self.manager.ownerViewController.view.animator addAnimation:self.springAnimation];
}

@end