lkzhao / elastictransition Goto Github PK
View Code? Open in Web Editor NEWA UIKit custom transition that simulates an elastic drag. Written in Swift.
License: MIT License
A UIKit custom transition that simulates an elastic drag. Written in Swift.
License: MIT License
like I said
I have many segues, the transitions look great but I think it may be too fast, is there a way to change that?
I'm using a UINavigationController
and triggering a modal segue to another view controller. The transition uses the top edge.
There is a bug that happens sometimes where when I go to perform the segue, the navigation controller's view will flicker and jump up behind the view that we are about to present.
I can't say for sure, but I have a feeling that this could be avoided by not altering the navigation controller's view at all, and instead using a snapshot view. I created an interactive transition from scratch earlier today and have been able to avoid this issue completely by creating a snapshot view with UIApplication.sharedApplication().delegate?.window!!.snapshotViewAfterScreenUpdates(false)
I take a snapshot of the window to capture the nav bar, set the actual nav controller view to hidden, animate the snapshot view during the transition, and when the transition animation is done I unhide the real navigation controller view.
Unfortunately I don't have time to fully test this and submit a PR right now but hopefully this might help anyone else who comes across this problem.
Hi, I imported ElasticTransition but when trying to make the UIViewController a ElasticModalViewController, it says "use of undeclared type".
How can I overcome this?
Hi there! I have been using this library for a while now, great work, really appreciate it! I was debugging my own project (which installed elastic transition) for some memory issues. I think I ended up discovering some strange behavior in elastic transition. The deinit function was never called in my view controller, so I commented out all code trying to figure out where the retain cycle was. Finally I found out the transition function was the one that actually caused this in the parent view controller. I then ran the example project using instruments. Here is what I found:
I also added deinit function to print something in the options view controller, but it was never printed until the second time the view controller is presented. I'm fairly sure there is a retain cycle somewhere. I then checked ElasticMenuTransitionDelegate trying to see if anything would have a strong reference to the view controller, but no luck there. Please take a look and let me know what you think. Thanks!
There are a couple of bugs in the version 2.0.1 (like viewControllerForKey(UITransitionContextFromViewControllerKey) exc_bad_instruction). They are fixed on 2.1.1.
Please merge on to master.
When try function handleLeftPan(pan:UIPanGestureRecognizer) in a UIView it works perfectly. But when try it on a UITableView, i got error "fatal error: unexpectedly found nil while unwrapping an Optional value" for code line transition.dissmissInteractiveTransition.
Already tried changing UIViewController to UITableViewController as below for function dissmissInteractiveTransition, but it's not working.
public func dissmissInteractiveTransition(viewController:UITableViewController, gestureRecognizer
Thank you and apologize in case it's a silly question.
When trying to subclass ElasticModalViewController in my project I get the error:
"Cannot inherit from non-open class 'ElasticModalViewController' outside of its defining module.
This happens because I've pulled in ElasticTransition with cocoa pods and its in a different module.
I have a project where I have a UINavigationController
and it's root controller. I have setup a modal segue from the nav controller to another controller in my Storyboard
. I have attached the pan gesture to the nav controller's UINavigationBar
. When the user swipes down on the nav bar, it triggers the modal segue that I setup on the storyboard, and the user can fully control the transition. This all works perfectly.
However, If I swipe very fast, about 1 out of 10 times something very strange happens. Here's a screenshot:
The main white view is where everything should be, but as you can see all of the other views are located up at the top and are not visible on screen at all. The top views have a y value of -667
, which is the height in points of the iPhone 6 I am testing on.
I need to fix this. For some reason when the user does a fast swipe all of this happens and then they basically get stuck with a blank screen.
it'd be cool to have a swift 3 version, if you have any interest to create a branch i would like to help with that.
Hi,
I have a scrollview in the view controller that is using this library in. It seems I can't scroll through the contents in the scrollview.
Does it support transitioning between views inside a navigation bar ?
Sorry lkzhao that I don't really have time to debug and make a pull request to help you but I hope I could at least report what I found while using your control.
Currently dismiss a ViewController which was presented modally with custom transition as ElasticTransition only work with animated = true. If animated is false, it will result in black / empty screen.
I guess this has something with rendering the underneath view controller while performing the custom transition.
Hi,
I have a project in which I use navigation controller and transition like "option" transition in your ezample project is not animating correctly. For example when I start the example project and tap on option button, the new controller slides from the bottom, and the parent controller slides upwards and dimes a bit so that the content of the parent controller is still visible. like in the picture:
As picture shows we can see the content of parent view controller it says: "navigation controller" in dimmed red letters and this is perfect, this is what I want. But when I add the navigation controller to the project and I add the following line as instructed in the manual:
self.navigationController?.delegate = transition
, no mater in which project the example one or in my project, this behaviour changes. It changes in a way that the content of a parent controller hides after cca. 1/2 of a second, and it reveals again when I try to scroll out the new controller:
Can you please help me to achieve the same result with project that use navigation controller?
Thx in advance...
PS. for second screenshot I had to change the segue to "present modally", cause with "show segue" the parent controller was all white.
Appears to be a part of the Example project
Hi guys,
I added ElasticTransition and MotionAnimator classes to my ObjC project, Xcode creates the Bridging header as usual, but ElasticTransition.swift cannot find MotionAnimation module.
Any idea?
Tks!
Sorry lkzhao that I don't really have time to debug and make a pull request to help you but I hope I could at least report what I found while using your control.
Currently, I have a MenuViewController presented modally using ElasticTransition. When I present SettingViewController on top of MenuViewController, and then dismiss SettingViewController.... the MenuViewController underneath is full screen width instead of custom width set on contentLength variable.
I am using storyboard with autolayout, btw.
Thank you for the cool library.
Hi,
I am using Xcode 7.3.1 and Swift 2.2
I am also using cocoa pods .
I installed the ElasticTransition project via cocoapods by adding the following lines
pod 'ElasticTransition', '~> 3.0.0'
the pod install went fine and the I see the frameworks downloaded in my project workspace which I added to my Project's linked frameworks section.
However I dont see that appearing when I try to import the lib.
Import ElasticTransition ( says "Cannot find underlying module for ElasticTransition" )
can you please check what the issue could be,
Thanks,
Priyadarshan
It would be interesting to develop an Objective-C version of this awesome transition.
I've been using ElasticTransition for a while. I love it! But I just did a pod update, and the new updated code made my transition super slow. I thought it was something wrong with my own code, but it is super slow too when I ran the new code from the repo. Any idea what's going on?
Hi, I manually added ElasticTransition, but the effects does not show up!
How to use it manually or with Carthage?!
Please! I love this framework!
If i transition to menu A , and dismissViewControllerAnimated with a completion to transition to ViewController B,then the backView will have offset which is equal to the ScreenHeight(or ScreenWidth) minus menu's contentLength
How to fix it?
it goes from one Uiviewcontroller to another and i can see the part where of the new view that its suppose to use the effect on but no elastic effect or mask on it just pops in and out
1.In the demo, after the actions took as described, the default transition disappear.
2.If I want the navigation view controller to be presented with the elastic transition, it seems that i should use nav.transitionDelegate = transition rather than nav.delegate = transition, but after doing that, something unexpected happened, my UIAlertViewController presented by my app disappear when it is presented, but it can still be interacted, like its view's alpha become 0 to me.
Hello,
On UINavigationController with delegate set to ElasticTransition, the Unwind completely breaks. Can you fix this somehow? Thank you.
Hi there, as title, How can I dismiss Menu screen without animation?
Is there any solution ?
Sometimes when dragging a view (presenting and dismissing), the app "freezes" and we can't navigate to other views.
Hello,
When using UIViewController by setting the delegate to ElasticTransition, I noticed that viewWillAppear of the old ViewController is being called again right after viewWillDisappear of that same ViewController.
For example, ViewController-A pushes to ViewController-B, the viewWillDisappear will be called on A, then viewWillAppear will be called on A (this should not be called). This may leads to many unexpected problems for some projects that have some logic bound to viewWillAppear.
When attempting to build, I get 50+ errors from MotionAnimation
Any plan for swift 4 update. There are two errors in MotionAnimation framework.
I used to be able to call performSegueWithIdentifier
using the iOS 9 SDK and Swift 2.2. However, it isn't working anymore in Swift 2.3 with the iOS 10 SDK. When I call peformSegueWithIdentifier
there is a fatal error because the presentingViewController is nil
and we are force unwrapping it.
Looking at the documentation it says that:
This parameter may also be nil to indicate that the presenting view controller will be determined later.
I'm currently trying to debug this but I am having some difficulty on finding a fix.
Thanks for this amazing library by the way!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.