Hero 是一个用于构建 iOS 视图控制器转换的库 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
newkengsir
V2EX    iOS

Hero 是一个用于构建 iOS 视图控制器转换的库

  •  
  •   newkengsir 2017-01-04 12:11:20 +08:00 3687 次点击
    这是一个创建于 3208 天前的主题,其中的信息可能已经有所发展或是发生改变。

    代码介绍地址

    Supercharged transition engine for iOS. Buid your custom view transitions with few lines of code or even no code at all. Inspired by Polymer's neon-animated-pages and Keynote's Magic Move.

    iOS 增压转换引擎。 使用几行代码或甚至没有代码构建您的自定义视图转换。 灵感来自 Polymer 的[neon-animated-pages]( https://elements.polymer-project.org/elements/neon-animation )和 Keynote 的“ Magic Move ”。

    Introduction 介绍

    Hero is a library for building iOS view controller transitions. It provides a layer on top of the UIKit's cumbersome transition APIs. Making custom transitions an easy task for developers.

    ** Hero **是一个用于构建 iOS 视图控制器转换的库。 它在 UIKit 的繁琐的转换 API 之上提供了一个层。 使自定义过渡对于开发人员来说是一个容易的任务。

    Features

    With Hero, you can easily mix & match these effects to build your own custom transition.

    At its core, Hero is similar to Keynote's Magic Move. It checks the heroID property on all source and destinations views. Every matched view pairs are then automatically transitioned from it's old state to it's new state.

    Hero can also construct animations for unmatched views. It is easy to define these animations via the heroModifiers property. Hero will run these animations alongside the Magic Move animations. All of these can be interactive, too.

    Hero does not make any assumption about how the view is built or structured. It will not modify any of your views' states other than hiding them during the animation. This means that it works with autolayout, programmatic layout, UICollectionView, UITableView, UINavigationController etc...

    核心, Hero 类似于 Keynote 的“魔法移动”。 它检查所有源和目的地视图的heroID属性。 然后,每个匹配的视图对自动地从其旧状态转换到其新状态。

    Hero 还可以为不匹配的视图构建动画。 很容易通过heroModifiers属性定义这些动画。 Hero 会在“魔法移动”动画旁边运行这些动画。 所有这些都可以是互动的。

    Hero 不会对视图是如何构建或构造的做出任何假设。 它不会修改任何视图的状态,除了在动画期间隐藏它们。 这意味着它适用于 autolayout , programmatic layout , UICollectionView , UITableView , UINavigationController 等...

    NOTE: Hero won't work on iPhone 7 Simulators due to a bug by Apple. Try using other simulators or a real device when working with Hero.

    Video Demo (Example Project)

    There are many examples shown in the HeroExamples project under the Examples folder. Clone or download the project to run it yourself. You can also view the video overview here.

    Installation & Usage Guide

    Hero is avaliable on Carthage & Cocoapods. See the usage guide for instructions.

    Simple Usage Examples

    You can do these in the storyboard too!

    For detailed explaination about Hero ID, Hero Modifiers, and supported animations:

    Read the usage guide

    This library is completely new and under heavy development. Might not be stable for production use, but there will be more things to come.

    1 条回复    2017-01-04 18:45:09 +08:00
    TomorJM
        1
    TomorJM  
       2017-01-04 18:45:09 +08:00
    已 star,真心赞!
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     2539 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 23ms UTC 14:58 PVG 22:58 LAX 07:58 JFK 10:58
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86