在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):HeroTransitions/Hero开源软件地址(OpenSource Url):https://github.com/HeroTransitions/Hero开源编程语言(OpenSource Language):Swift 92.1%开源软件介绍(OpenSource Introduction):Hero is a library for building iOS view controller transitions. It provides a declarative layer on top of the UIKit's cumbersome transition APIs—making custom transitions an easy task for developers. Hero is similar to Keynote's Magic Move. It checks the Hero can also construct animations for unmatched views. It is easy to define these animations via the At view controller level, Hero provides several template transitions that you can set through By default, Hero provides dynamic duration based on the Material Design Motion Guide. Duration is automatically determined by changes to distance and size—saving you the hassle, while providing consistent and delightful animations. Hero doesn't make any assumptions about how the view is built or structured. It won't modify any of your views' states other than hiding them during the animation. This makes it work with Auto Layout, programmatic layout, UICollectionView (without modifying its layout object), UITableView, UINavigationController, UITabBarController, etc... Usage Example 1View Controller 1redView.hero.id = "ironMan"
blackView.hero.id = "batMan" View Controller 2self.hero.isEnabled = true
redView.hero.id = "ironMan"
blackView.hero.id = "batMan"
whiteView.hero.modifiers = [.translate(y:100)] Usage Example 2View Controller 1greyView.hero.id = "skyWalker" View Controller 2self.hero.isEnabled = true
greyView.hero.id = "skyWalker"
// collectionView is the parent view of all red cells
collectionView.hero.modifiers = [.cascade]
for cell in redCells {
cell.hero.modifiers = [.fade, .scale(0.5)]
} You can do these in the storyboard too! InstallationCocoaPodsAdd the following entry to your Podfile: pod 'Hero' Then run Don't forget to CarthageAdd the following entry to your
Then run If this is your first time using Carthage in the project, you'll need to go through some additional steps as explained over at Carthage. AccioAdd the following to your .package(url: "https://github.com/HeroTransitions/Hero.git", .upToNextMajor(from: "1.4.0")), Next, add .target(
name: "App",
dependencies: [
"Hero",
]
), Then run Swift Package ManagerTo integrate using Apple's Swift package manager, add the following as a dependency to your .package(url: "https://github.com/HeroTransitions/Hero.git", .upToNextMajor(from: "1.3.0")) and then specify // swift-tools-version:4.0
import PackageDescription
let package = Package(
name: "MyPackage",
products: [
.library(
name: "MyPackage",
targets: ["MyPackage"]),
],
dependencies: [
.package(url: "https://github.com/HeroTransitions/Hero.git", .upToNextMajor(from: "1.6.1"))
],
targets: [
.target(
name: "MyPackage",1.6.1
dependencies: ["Hero"])
]
) Manually
DocumentationsCheckout the WIKI PAGES (Usage Guide) for documentations. For more up-to-date ones, please see the header-doc. (use alt+click in Xcode) Interactive Transition TutorialsInteractive transitions with Hero (Part 1) FAQ
Not able to use Hero transition even when |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论