diff options
author | v.mikhaylenko <v.mikhaylenko@corp.mail.ru> | 2015-05-21 15:46:10 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:52:38 +0300 |
commit | 279e4649433bcbc06e888d557f77d7dd8708fa98 (patch) | |
tree | 2e41fa51f21d070086c2f591287b9ed82cced551 /iphone/Maps/Classes/MWMPlacePage+Animation.mm | |
parent | 9d2141ae12860ba6f587c97ca31d3986be2a4b51 (diff) |
[ios] Added place page for landscape and portrait iPhone. Improved UI.
Diffstat (limited to 'iphone/Maps/Classes/MWMPlacePage+Animation.mm')
-rw-r--r-- | iphone/Maps/Classes/MWMPlacePage+Animation.mm | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/iphone/Maps/Classes/MWMPlacePage+Animation.mm b/iphone/Maps/Classes/MWMPlacePage+Animation.mm new file mode 100644 index 0000000000..38432f5aa6 --- /dev/null +++ b/iphone/Maps/Classes/MWMPlacePage+Animation.mm @@ -0,0 +1,45 @@ +// +// MWMPlacePage+Animation.m +// Maps +// +// Created by v.mikhaylenko on 19.05.15. +// Copyright (c) 2015 MapsWithMe. All rights reserved. +// + +#import "MWMPlacePage+Animation.h" +#import "MWMSpringAnimation.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 +{ + [self cancelSpringAnimation]; + self.springAnimation = [MWMSpringAnimation animationWithView:placePage.extendedPlacePageView target:placePage.targetPoint velocity:velocity]; + [self.manager.ownerViewController.view.animator addAnimation:self.springAnimation]; +} + +@end |