touchwonders / transition Goto Github PK
View Code? Open in Web Editor NEWEasy interactive interruptible custom ViewController transitions
License: MIT License
Easy interactive interruptible custom ViewController transitions
License: MIT License
After clicking on a cell, the expansion animation seems like it's not taking the safety margins into account.
Here is the error log for your reference :D
2018-10-14 22:11:19.430659-0500 Transition_Example[48438:2420401] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x600002cb21c0 Transition_Example.CollectionViewCell:0x7fd929c67b50.height == 399.967 (active)>",
"<NSLayoutConstraint:0x600002cb2580 'UIView-Encapsulated-Layout-Height' Transition_Example.CollectionViewCell:0x7fd929c67b50.height == 400 (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600002cb2580 'UIView-Encapsulated-Layout-Height' Transition_Example.CollectionViewCell:0x7fd929c67b50.height == 400 (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2018-10-14 22:11:19.488227-0500 Transition_Example[48438:2420401] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x600002cb21c0 Transition_Example.CollectionViewCell:0x7fd929c67b50.height == 399.967 (active)>",
"<NSLayoutConstraint:0x600002cb2580 'UIView-Encapsulated-Layout-Height' Transition_Example.CollectionViewCell:0x7fd929c67b50.height == 400 (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600002cb2580 'UIView-Encapsulated-Layout-Height' Transition_Example.CollectionViewCell:0x7fd929c67b50.height == 400 (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
Hi,
where can I find the demo project with the pinterest transition?
In the readme there is the gif, but I didn't found it in the example directory.
In the README file there is a beautiful demo of transition: https://github.com/Touchwonders/Transition/raw/master/Documentation/artwork/navigation.gif
An example app called "Navigation" has bit similar push transition, however it has a default ios pop transition. Is it intentional that the pop transition is default or Transition package does not work expected in iOS 14?
Would you mind elaborating how to accomplish a transition like in README demo?
Hi,
Great library. I'm trying to do a simple interactive modal transition. I'm using PanInteractionController(forModalTransitionsAtEdge...) and the TransitionController(forInteractiveModalPresentationsFrom...) to setup the interactionController and transitionController. Presenting works fine.
When I try to dismiss the view by flicking upwards, I get "fatal error: unexpectedly found nil while unwrapping an Optional value" in "UIViewControllerContextTransitioning+Properties.swift". Basically "toView" is nil here:
case .dismiss: if toView.superview == nil { containerView.insertSubview(toView, belowSubview: fromView) }
Is this an issue, or am I not setting up the transition controller correctly.
Thanks.
Jan-Michael
PS: Here's the code to produce the issue. The StickerViewController is just a view with a UILabel.
import UIKit
import Transition
class ViewController: UIViewController
{
private(set) var transitionController: TransitionController!
private(set) var interactionController: PanInteractionController!
fileprivate weak var stickerViewController: StickerViewController?
override func viewDidLoad()
{
super.viewDidLoad()
self.view.backgroundColor = UIColor.red
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
if interactionController == nil
{
self.interactionController = PanInteractionController(forModalTransitionsAtEdge: .top)
self.transitionController = TransitionController(forInteractiveModalPresentationsFrom: self, transitionsSource: self, interactionController: interactionController)
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
extension ViewController : TransitionsSource
{
// proivide transition for presentation / dismissal
func transitionFor(operationContext: TransitionOperationContext, interactionController: TransitionInteractionController?) -> Transition
{
//animation
let transitionAnimation = MoveTransitionAnimation(forModalTransitionsAtEdge: .top)
let transition = Transition(duration: 0.4, animation: transitionAnimation)
return transition
}
}
extension ViewController : InteractiveModalTransitionOperationDelegate
{
func viewControllerForInteractiveModalPresentation(by sourceViewController: UIViewController, gestureRecognizer: UIGestureRecognizer) -> UIViewController
{
let vc = self.storyboard?.instantiateViewController(withIdentifier: "sticker")
vc?.modalPresentationStyle = .overCurrentContext
vc?.transitioningDelegate = self as? UIViewControllerTransitioningDelegate
self.stickerViewController = vc as? StickerViewController
return vc!
}
}
This project uses many methods deprecated in Swift 4.2. Right now, it is possible to build it with Swift 4.0 and include it in a project build with Swift 4.2. However, it would be nice to have an update to the project itself to work with Swift 4.2.
When I start interactive unwinding and cancel it by releasing my finger before threshold is passed, transition becomes broken. Please see following video explanations: https://www.dropbox.com/s/v6vb2gczopew1sw/Transition.mov
Hi,
Any news on moving officially to 4+ ?
Regards,
H.
Hello.
Can you please add new release including spm support with a new tag?
Flicking to dismiss view controllers breaks the animations. You can get stuck between two states. I was able to repro using Modal Transition example and Pinterest example easily.
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.