123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #import "SidebarAnimation.h"
-
-
-
- @implementation SidebarAnimation
-
- static UIColor *overlayContentColor;
-
- +(void)setOverlayContentColor:(UIColor*)color {
- overlayContentColor = color;
- }
-
- +(UIColor*)overlayContentColor {
- return overlayContentColor;
- }
-
- + (void)animateContentView:(UIView *)contentView sidebarView:(UIView *)sidebarView fromSide:(Side)side visibleWidth:(CGFloat)visibleWidth duration:(NSTimeInterval)animationDuration completion:(void (^)(BOOL))completion
- {
-
- }
-
- + (void)reverseAnimateContentView:(UIView *)contentView sidebarView:(UIView *)sidebarView fromSide:(Side)side visibleWidth:(CGFloat)visibleWidth duration:(NSTimeInterval)animationDuration completion:(void (^)(BOOL))completion
- {
-
- }
-
- + (void)resetSidebarPosition:(UIView *)sidebarView
- {
- CATransform3D resetTransform = CATransform3DIdentity;
- resetTransform = CATransform3DRotate(resetTransform, DEG2RAD(0), 1, 1, 1);
- resetTransform = CATransform3DScale(resetTransform, 1.0, 1.0, 1.0);
- resetTransform = CATransform3DTranslate(resetTransform, 0.0, 0.0, 0.0);
- sidebarView.layer.transform = resetTransform;
-
- CGRect resetFrame = sidebarView.frame;
- resetFrame.origin.x = 0;
- resetFrame.origin.y = 0;
- sidebarView.frame = resetFrame;
-
- [sidebarView.superview sendSubviewToBack:sidebarView];
- sidebarView.layer.zPosition = 0;
- }
-
- + (void)resetContentPosition:(UIView *)contentView
- {
- CATransform3D resetTransform = CATransform3DIdentity;
- resetTransform = CATransform3DRotate(resetTransform, DEG2RAD(0), 1, 1, 1);
- resetTransform = CATransform3DScale(resetTransform, 1.0, 1.0, 1.0);
- resetTransform = CATransform3DTranslate(resetTransform, 0.0, 0.0, 0.0);
- contentView.layer.transform = resetTransform;
-
- CGRect resetFrame = contentView.frame;
- resetFrame.origin.x = 0;
- resetFrame.origin.y = 0;
- contentView.frame = resetFrame;
-
- [contentView.superview bringSubviewToFront:contentView];
- contentView.layer.zPosition = 0;
- }
-
-
- +(UIView*)overlayContentView:(CGRect)frame {
-
- static UIView *overlayView;
- static dispatch_once_t onceToken;
-
- dispatch_once(&onceToken, ^{
- overlayView = [[UIView alloc] initWithFrame:frame];
- overlayView.backgroundColor = [UIColor clearColor];
- overlayView.userInteractionEnabled = NO;
- });
-
- return overlayView;
- }
-
-
- @end
|