[翻译] iOSSharedViewTransition

简介:

iOSSharedViewTransition

 

iOS 7 based transition library for View Controllers having a Common View

基于iOS7的变换view用的库,让视图控制器共享一个共有的view.

  • Inspired by Shared View Activity Transitions introduced in Android L. 灵感来自于Android L

 

USAGE

Very Simple 3 Step Process:

非常简单,3步搞定:

  • Download and include ASFSharedViewTransition.h and ASFSharedViewTransition.m in your Project. 下载项目,然后将ASFSharedViewTransition.h / .m文件拷贝到你的项目当中
  • In your app delegate or somewhere else in code do #import "ASFSharedViewTransition.h" and add tansitions like this: 在你的appdelegate方法或者是其他地方,引入头文件ASFSharedViewTransition.h,如下所示
[ASFSharedViewTransition addTransitionWithFromViewControllerClass:[ViewController class]
        ToViewControllerClass:[DetailViewController class]
     WithNavigationController:(UINavigationController *)self.window.rootViewController
                 WithDuration:0.3f];

Note: Transition needs to be added only one time and ASFSharedViewTransition will automatically apply transitions whenever specified UINavigationController navigates between any FromViewController and ToViewController instances.

注意:转换的效果只需要被加载一次.之后,ASFSharedViewTransition就会作用在任何UINavigationController与FromViewController之间.

  • Confirm From & To View Controllers to ASFSharedViewTransitionDataSource and provide the Common View by implementing this method: 要确保原控制器与待转换控制器实现了协议方法ASFSharedViewTransitionDataSource.
- (UIView *)sharedView

Thats it! A Sample Demo Application has been included for help.

就酱紫!你可以查看下demo看看.

 

Installation

iOSSharedViewTransition is available through CocoaPods. To install it, simply add the following line to your Podfile:

你可以用CocoaPods安装:

pod 'iOSSharedViewTransition', '~> 1.0.2'

 

Coming Soon

  • Adding more transitions to the library 添加更多的转换效果
  • If you would like to request a new feature, feel free to raise as an issue. 如果你有什么好的提议,尽快告诉我

 

Author

Asif Mujteba, asifmujteba@gmail.com

 

License

ASFSharedViewTransition is available under the MIT license. See the LICENSE file for more info.

目录
相关文章
|
11天前
|
弹性计算 关系型数据库 微服务
基于 Docker 与 Kubernetes(K3s)的微服务:阿里云生产环境扩容实践
在微服务架构中,如何实现“稳定扩容”与“成本可控”是企业面临的核心挑战。本文结合 Python FastAPI 微服务实战,详解如何基于阿里云基础设施,利用 Docker 封装服务、K3s 实现容器编排,构建生产级微服务架构。内容涵盖容器构建、集群部署、自动扩缩容、可观测性等关键环节,适配阿里云资源特性与服务生态,助力企业打造低成本、高可靠、易扩展的微服务解决方案。
1230 5
|
10天前
|
机器学习/深度学习 人工智能 前端开发
通义DeepResearch全面开源!同步分享可落地的高阶Agent构建方法论
通义研究团队开源发布通义 DeepResearch —— 首个在性能上可与 OpenAI DeepResearch 相媲美、并在多项权威基准测试中取得领先表现的全开源 Web Agent。
1213 87
|
10天前
|
云栖大会
阿里云云栖大会2025年9月24日开启,免费申请大会门票,速度领取~
2025云栖大会将于9月24-26日举行,官网免费预约畅享票,审核后短信通知,持证件入场
1796 13
|
20天前
|
人工智能 运维 安全
|
3天前
|
资源调度
除了nrm-pm,还有哪些工具可以管理多个包管理器的源?
除了nrm-pm,还有哪些工具可以管理多个包管理器的源?
234 127
|
4天前
|
前端开发
Promise的then方法返回的新Promise对象有什么特点?
Promise的then方法返回的新Promise对象有什么特点?
177 2