Giter VIP home page Giter VIP logo

hero's People

Contributors

2blane avatar adamcumiskey avatar alexandrgraschenkov avatar andreamiotto avatar angelolloqui avatar aragevorkian avatar av0c0der avatar be-meyer avatar bradphilips avatar christopherrogers avatar cmilr avatar craftedbymax avatar danielsaidi avatar ddomovoj avatar e28eta avatar fruitcoder avatar idevid avatar joematt avatar limsangjin12 avatar lkzhao avatar manuege avatar mrs- avatar nick-potts avatar nn1900 avatar nrgbistro avatar onevcat avatar sd10 avatar simoalx avatar tadija avatar thii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hero's Issues

No such module Hero

After installing the pod file when I try to import Hero I'm getting a No such module Hero error. Why is it so? Can you help me on this?

UIImageView

Hi, great library!

I face an issue, is there a possible reason why I cant set the HeroId for an UIImageView? Checked the code and the extension is set to UIView, so I don't see any obvious reason why the UIImageView doesn't use the Hero extension...

Any help appreciated

Edit: The UIImageView I'm using is a custom subclass with a bunch (lots) of IBInspectable, it seems to me like XCode can only display a certain amount of Inspectables and drops the others ...

Push segues

Is there any plan to add push segues support?

Unwind Segues not triggering Hero transitions

When I navigate via an Unwind Segue my Hero-based transition doesn't work. Instead of abiding by the "Source()" modifier I set in the storyboard, it just uses the default vertical sliding transition animation. However, it works perfectly for other segues, just not Unwind segues. Does anybody know how to fix this issue?

The CG extension overloads are declared internal but then used publicly

What I ran into was pulling your ImageGallery example code into my project as a baseline for modification to my needs.

What I immediately ran into was in ImageViewController.swift on line 67

ImageGallery/ImageViewController.swift:67:38: Binary operator '+' cannot be applied to two 'CGPoint' operands.

This is declared internal in CG+Hero.swift on line 76. Since I am pulling this in as a pod while the example code is just an internal library I get the error and it doesn't.

I had to change the CG+Hero.swift to public to get that code to compile in my project. Should all the overloads just be made public? I am just starting to use this maybe there is a reason not to do that. I would rather use pods than copy it locally if possible.

Thanks and this library really looks like it's going to be very useful.

Apple TV

Please, could you add apple tv support

Redesign `heroModifiers` to not be a string API

I think the API would be far clearer and easy to use if heroModifers wasn't a string. The benefits of a non "stringly-typed" API are pretty clear, but to outline a few:

  • Improved safety
  • Compiler checking
  • Easier discoverability and documentation

I would love to take on this task, but I wanted to ask which of two directions I should go, and if you might merge a PR like this before I start working on it.

Option 1

Introduce a new Enum with associated values for each Modifier - something like

enum Modifier {
    case scale(CGFloat)
    case fade
    case ...
}

Views would retain the heroModifiers property, but it would become an array of Modifier, used like this: foo.heroModifiers = [.fade, .scale(0.5)].

This design is nice because an enum encapsulates the possible modifiers well, especially with associated values. One drawback is that it's unclear at usage that you can only use one of each Modifier. However, the current String API also has this problem.

Option 2

Introduce a new Modifiers struct with optional properties for each Modifier, something like:

struct Modifiers {
    var scale: CGFloat?
    var fade = false
    var transform: (CGFloat, CGFloat)?
    ...
}

This design is nice because it ensures one of each Modifier is used at the most. Views would also have a heroModifiers property, but would be the type of the struct. This design might be used like this:

foo.heroModifiers.scale = 0.5
foo.heroModifiers.fade = true

I'd love your opinion on this, or would love to know if you're already working on something similar. I'd love to help implement it!

wrong extend edges effect

I have UITabBarController, and first tab displays NavigationController.
The Root ViewController shows fine.
But if I push the second ViewController with hero enabled, then it extends edges under Tabbars, even though I unchecked the "Under Bottom Bars" in the Storyboard Option.

image

The weird thing is that if I select other tab and comes back to previous tab, then the viewcontroller shows correctly, not under-the-bottom-bars.

ezgif com-1e06c4e359

Any advice is greatly appreciated,

When Hero enabled, self.view.alpha is always 1

I wanted to add some Hero beautiful transitions between 2 controllers. The destination controller isn't completely opaque (alpha = 0.9), to let you see the original controller behind.
In this case, here are segue parameters:
Kind: present modally
Presentation: Over current Context
Transition: Default

But using Hero set self.view.alpha to 1.0 at the end of the transition.
I just added Hero on a button, with the following modifier: zPosition(2)

Is it possible to keep some transparency using Hero?
Thanks!

Custom NavigationController Delegate

I have a custom segue class that instantiates a UINavigationController class like this:

class CustomNavSegue: UIStoryboardSegue {

    override func perform() {
        let nav = ModalNavigationController(rootViewController: destination)
        nav.isHeroEnabled = true
        nav.modalPresentationStyle = .overCurrentContext
        source.present(nav, animated: true, completion: nil)
    }
}

In the ModalNavigationController viewDidLoad I set delegate = self since I need to perform a custom action on:

extension ModalNavigationController: UINavigationControllerDelegate {
    func navigationController(_ navigationController: UINavigationController,
                              willShow viewController: UIViewController,
                              animated: Bool) {
        //need to configure something on viewController.view
    }
}

However, when I set nav.isHeroEnabled I see that the navigationController's delegate gets set to Hero.shared.
Basically both need to be the delegate even though they need different method callbacks.

Do you have any ideas for solutions?
Maybe Hero could expose an extra navigationDelegate:UINavigationControllerDelegate property that only replays the callbacks it receives (probaby worth doing for other delegates as well).

Interactive Transitions

Hey, You noted that we can make interactive transitions. I have been scouring the example and the issues for some documentation or example, but I can't find any.

Can @lkzhao give me a few pointers? Like I'm trying to find how you did the image viewer fade animation.

Many Thanks

Can only be used in Present ViewController?

In the Demo, I put the “present(vc, animated: true, completion: nil)” replaced with “self.navigationController?.pushViewController(vc, animated: true)”,the view's animation effects disappear

Hero modifiers don't affect transition

I have removed Hero modifiers from the Demo App, one-by-one and didn't notice any difference in the App behavior running in iPhone 5(iOS 9.0) Simulator.

OverCurrentContext Support.

Hero doesn't have support for these modal presentation styles yet. Would be a bit tricky to implement since Hero needs to keep track of the presented view controllers.

Related to #34 #26

Pod can not find Hero libary

my CocoaPods version is 1.20rc.

When run pod search 'Hero',telling that no this libary,Is there any help?

Hope for your replay.

Actually transfer views

I really like the elegance of your API and the approach of associating pairs of views using the heroID. Sometimes, there are situations where I want to actually transfer a specific view instance from one view controller to another. This is needed for complex views with opaque state such as MKMapView or EAGLView. I'd love to see support for such use cases!

I would envision to associate pairs of container views with a similar heroID mechanism and then insert the view into the paired container view at the start of the transition. Of course it's a bit tricky to install new constraints etc. so we'd need an afterTransfer configuration block or something similar where we could setup constraints.

I'm sure this would be a very useful addition! What do you think?

Somewhere hard to understand

I am confused about this in HeroDefaultAnimatorViewContext .swift

// duration is 0.2 @ 0 to 0.375 @ 500
defaultDuration = 0.208 + Double(movePoints.clamp(0, 500)) / 3000

After checking Duration and easing, I still cannot figure out what does the magic number 0.208, 3000 mean.

Could you please give some tips? How is the default animation duration determined?

Thanks a lot.

Breaking changes since v0.1.8

In v0.1.8, some UI gliches appear when transitioning using matched views. In my case i'm doing a transition using matched views where width of both views are not exactly the same. The glitch seems to happen when removing the snapshot view. Flickering happens since width of both views do not match. This glitch didn't happen in v0.1.7.

In v0.1.9, transition using paired views only seems to work in one direction. When presenting the view controller, it seems only the default cross-fade transition occurs. On the other side, when dismissing the view controller the matched views transition works properly.

UITapGestureRecognizers are not working

I'm presenting view controller with one simple subview using heroReplaceViewController(with: myViewController) and everything is ok with animations. But UITapGestureRecognizer that's added to subview is not working. When I replace heroReplaceViewController method with present(myViewController, animated: true, completion: nil) tap gesture recognizer is working normally.

Could this be some problem with library?

Stackview with Autolayout Issues

Probably related to #14

I updated the basic example to use StackViews and had a few issues:

  1. I had to set the autolayout priority to 999 for the height constraint in a horizontal stackview and for the width constraint in a vertical stackview, otherwise, it would complain about an ambiguous layout.

  2. The animations still look a bit off, you can see from the image below, in the 1st animation, all labels jump after the screen initially loads. The 2nd animation just doesn't look right.

HELLO

I have the code I used up here:
https://github.com/felix-dumit/Hero/tree/stackview-autolayout

Thanks for this lib I think it's really awesome!

Entire UI flashes white on transitions in newest update

Completely programmatic app. Using a collection view with a navigation controller that calls "show" to a simple detail view controller upon selecting a cell. Immediately after hitting a cell the entire screen flashes and then the smooth transition works as expected.

Install

Hi,
I can not install the library. i Install podfile and after ?? Is there any video tutorial? I'm starting with swift.

Thank you

Animations don't work in the simulator

First — thanks for this awesome library! It'll make so many tasks so much easier.

Apologies if this a known issue, or something that can't be fixed, but I just wanted to point out that animations aren't working for me in the simulator (though they work fine on the device).

Here is a video of it working on my iPhone 6s Plus.

Here is a video of how it behaves in the simulator (iPhone 7).

Hero doesn't work in UIViewControllers created programmatically

I'm trying to use Hero in view controllers created purely in code, without storyboards, with pushViewController and it's not working:

class LiveInjection3ViewController: UIViewController, HeroViewControllerDelegate {
  func heroWillStartTransition() {
    // ...
  }
}

let vc = LiveInjection3ViewController()
vc.isHeroEnabled = true
navigationController.pushViewController(vc, animated: true)

Is it not working because:
a) Hero supports segues only❓
b) Hero supports view controllers created with storyboard only❓
c) I missed sth else❓

💯

Transition "flashes" view temporarily disappearing?

Hi there,

I love the idea of this library! I'm just getting started and was trying it out a bit Storyboard-only, animating a simple UIView in size and position. It works as expected, except I noticed that the view quickly flashes away (disappears) before reappearing in the animation. I'm sure I've probably just got something mis-configured, but I'm not quite sure what it is - any thoughts?

Here is a gif, and here is a link to my project (simplest possible configuration, Storyboard only!).

flash

React Native Help Wanted!!!

It would be so cool if this framework can work with React Native.

Since React Native already have declarative view informations upon each render call (before creating the views). I am visioning that with React Native, Hero can handle all animations through out the App. If the component has Hero enabled. Then on each render call, Hero can do a comparison and animate the changes.
This is what I originally had in mind when building Hero. Handling animations for state change through out the App. View controllers can tell Hero to animate to another state without transitioning to another view controller. but that requires building some other declarative state holder.

I have worked with React about a year ago. Loved their framework but hated the animation aspect of it. I think animation has always been a weak point for it. Would be very useful if React Native and work with Hero.

First step of course, is just to support view controller transitions in React Native. But I have no experience working with it.
What do you guys think? Is anyone familiar with it?

Animations not working on Simulator in iOS 10.2

Hey! Amazing library, it looks stunning. 👏
I was testing it out on the Simulator but it looks like the animations are not working correctly in Xcode 8.2. Is it a bug or maybe something that should be mentioned in the README?

Testing on the device works perfectly! 😄

UIVisualEffectView transition

I added a UIVisualEffectView to the MusicPlayer example to simulate this issue.
It breaks during the transition and also after the transition is complete it's still not the way it should be.

Hero off

Hero off

Hero on

Hero on

Console outputs this warning:

[Warning] <UIVisualEffectView 0x7fa50e80b830> is being asked to animate its opacity. This will cause the effect to appear broken until opacity returns to 1.

Code used is available here: https://github.com/felix-dumit/Hero/tree/visual-effect-snapshot

Any ideas? Maybe take a snapshot of the window at the effectView (final) bounds?

I played around with this idea here: 7d9f0f1

Still needs some work but here is an initial result:
Temp anim
It still breaks once the animation is complete, though.

This is probably an unrelated question, but in the above scenario, how could I make it so the effectView frame doesn't animate (i.e it already starts with the the final frame)?

API for manually specifying views to animate

I'm working on an integration with React Native, and I'm at the point where I think I can get this working if I have one thing: a function that will start an animation given an array of from views an and array of to views. If you look at Hero.start, most of the code only deals these lists of views from HeroContext.

Am I wrong in thinking that if on the React Native side I do all the work to figure out the from/to views, that I could get integration with Hero working if we provide that API? It would bypass parts of Hero that do the storyboard integration and automatically hooking up views, and only do the animations.

Use Hero Transitions with Custom Segues?

I'm trying to use a custom segue to slide a view from the bottom of the screen up to around 80 points from the top. This view then has a next button at the bottom, which when pressed will hopefully utilise Hero transitions.

Issue:
I can only get the transitions to work if I use hero_replaceViewController(). However, when i do use this, my view is no longer 80 points from the top but instead it is full screen again. I've tried to transform the view again at various points with no luck.

If i don't use hero_replaceViewController(), then the transitions do not work but the destination view frame is the correct size. I was thinking this may be down to me using custom storyboard segues instead of the standard push, etc?

Any thoughts?

Animate according to the content mode. i.e. UIImageView with aspectFill

For views that draw according their layer's content, the content mode is not recognized.

It is noticeable when animating the size of an imageView. The content of the source imageView appear to be stretched (not keeping its aspect ratio). For imageView with aspectFit or aspectFill. The correct behavior should grow the bounds while keeping the aspect ratio.

I have a fix in mind. But need some time to make the modification.

Perform animation when application starts

I am trying to make the next animation when application starts,
I want to animate collection view cell and show them in cascade but I don't know how to do it, modifier only works when a transition is performed.
is it posible without view controller transition ?

ezgif com-556ffd625d

image animation

@pborreli @e28eta @mRs- @sgl0v @CalebeNP I have an image animation where an image inside a cell goes to fill the entire view of the view controller. Do you mind helping me. Because it almost looks like the images overlaps the image of the detail page view controller and then disappears.

Tutorial is missing

When I clicked on the Tutorial I was presented with the "Create Page" webpage.

Buddy Build - Build Failed

Im using buddybuild.com and it keeps spitting out this error causing the build to fail.

** BUILD FAILED **
170
    The following build commands failed:
171
    	CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
172
    	CompileSwift normal x86_64 /tmp/sandbox/workspace/Pods/Hero/Hero/CAMediaTimingFunction+Hero.swift
173
    	CompileSwift normal x86_64 /tmp/sandbox/workspace/Pods/Hero/Hero/HeroDefaultAnimatorViewContext.swift
174
    (3 failures)

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.