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: a704eb2952197df3249ad8e6a600698345a42878 (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
37
38
39
40
41
42
43
44
//
//  MWMPlacePage+Animation.m
//  Maps
//
//  Created by v.mikhaylenko on 19.05.15.
//  Copyright (c) 2015 MapsWithMe. All rights reserved.
//

#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