添加HWPanModal和FLAnimatedImage

This commit is contained in:
2025-11-05 22:04:56 +08:00
parent efdcf60ed1
commit abf32e8457
97 changed files with 10853 additions and 2067 deletions

View File

@@ -0,0 +1,17 @@
//
// HWPageSheetPresentingAnimation.h
// HWPanModal-iOS10.0
//
// Created by heath wang on 2019/9/5.
//
#import <Foundation/Foundation.h>
#import "HWPresentingVCAnimatedTransitioning.h"
NS_ASSUME_NONNULL_BEGIN
@interface HWPageSheetPresentingAnimation : NSObject <HWPresentingViewControllerAnimatedTransitioning>
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,29 @@
//
// HWPageSheetPresentingAnimation.m
// HWPanModal-iOS10.0
//
// Created by heath wang on 2019/9/5.
//
#import "HWPageSheetPresentingAnimation.h"
@implementation HWPageSheetPresentingAnimation
- (void)presentAnimateTransition:(nonnull id <HWPresentingViewControllerContextTransitioning>)context {
NSTimeInterval duration = [context transitionDuration];
UIViewController *fromVC = [context viewControllerForKey:UITransitionContextFromViewControllerKey];
[UIView animateWithDuration:duration delay:0 usingSpringWithDamping:0.9 initialSpringVelocity:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
CGFloat statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.height;
CGFloat scale = 1 - statusBarHeight * 2 / CGRectGetHeight(fromVC.view.bounds);
fromVC.view.transform = CGAffineTransformMakeScale(scale, scale);
} completion:^(BOOL finished) {
}];
}
- (void)dismissAnimateTransition:(nonnull id <HWPresentingViewControllerContextTransitioning>)context {
UIViewController *toVC = [context viewControllerForKey:UITransitionContextToViewControllerKey];
toVC.view.transform = CGAffineTransformIdentity;
}
@end

View File

@@ -0,0 +1,17 @@
//
// HWShoppingCartPresentingAnimation.h
// HWPanModal-iOS10.0
//
// Created by heath wang on 2019/9/5.
//
#import <Foundation/Foundation.h>
#import "HWPresentingVCAnimatedTransitioning.h"
NS_ASSUME_NONNULL_BEGIN
@interface HWShoppingCartPresentingAnimation : NSObject <HWPresentingViewControllerAnimatedTransitioning>
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,39 @@
//
// HWShoppingCartPresentingAnimation.m
// HWPanModal-iOS10.0
//
// Created by heath wang on 2019/9/5.
//
#import "HWShoppingCartPresentingAnimation.h"
@implementation HWShoppingCartPresentingAnimation
- (void)presentAnimateTransition:(nonnull id <HWPresentingViewControllerContextTransitioning>)context {
NSTimeInterval duration = [context transitionDuration];
UIViewController *fromVC = [context viewControllerForKey:UITransitionContextFromViewControllerKey];
CGFloat statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.height;
CGFloat scale = 1 - statusBarHeight * 2 / CGRectGetHeight(fromVC.view.bounds);
[UIView animateWithDuration:duration * 0.4 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{
CATransform3D tran = CATransform3DIdentity;
tran.m34 = -1 / 1000.0f;
tran = CATransform3DRotate(tran, M_PI / 16, 1, 0, 0);
tran = CATransform3DTranslate(tran, 0, 0, -100);
fromVC.view.layer.transform = tran;
} completion:^(BOOL finished) {
[UIView animateWithDuration:duration * 0.6 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{
fromVC.view.layer.transform = CATransform3DMakeScale(scale, scale, 1);
} completion:^(BOOL finished) {
}];
}];
}
- (void)dismissAnimateTransition:(nonnull id <HWPresentingViewControllerContextTransitioning>)context {
UIViewController *toVC = [context viewControllerForKey:UITransitionContextToViewControllerKey];
toVC.view.layer.transform = CATransform3DIdentity;
}
@end