Giter Site home page Giter Site logo

Comments (5)

HeathWang avatar HeathWang commented on May 14, 2024

目前presentingVC的动画没有可配置参数,其动画时间依赖- (NSTimeInterval)transitionDuration;
你的需求是什么,因为目前动画分2段,暴露参数的话需要2个可配置参数来处理。

from hwpanmodal.

fuchenxi avatar fuchenxi commented on May 14, 2024

请原谅我的钻牛角尖 (~ ̄▽ ̄)~
仔细观察了下京东的加购, 发现动画的细节是有一定差异的

if ([presentable shouldAnimatePresentingVC]) {
        [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(0.93, 0.93, 1);
            } completion:^(BOOL finished) {
                
            }];
        }];
    }
[UIView animateWithDuration:[presentable transitionDuration] * 0.6 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
        toVC.view.layer.transform = CATransform3DIdentity;
    } completion:^(BOOL finished) {        
}];

您动画的核心代码是上述, present时设置了CATransform3D, dismiss时是直接恢复初始值。目前api是无法修改这个动画的参数的。

之后应该可以加些可控的参数来自定义动画吧? 比如使用个配置个block

from hwpanmodal.

HeathWang avatar HeathWang commented on May 14, 2024

你是想要高度自定义该动画还是只是修改参数?

from hwpanmodal.

fuchenxi avatar fuchenxi commented on May 14, 2024

高度自定义 自己来操控 fromVc和toVc的transform

from hwpanmodal.

HeathWang avatar HeathWang commented on May 14, 2024

hi, 完全高度自定义fromVC & toVC不现实,该框架原始初衷是从底部弹出视图,手势拖拽dismiss视图。
针对present动画的配置项很多,无须使用者再去手写代码高度自定义toVC的动画。

如果你有需求,后面考虑针对presenting VC动画提供接口。

from hwpanmodal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.