Code Monkey home page Code Monkey logo

tllayouttransitioning's People

Contributors

adriantofan avatar dillan avatar falconser avatar readmecritic avatar wtmoose 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

tllayouttransitioning's Issues

Resize / scale question

I'm playing around with the transition of the CollectionViewLayout of the examples (pinch or resize) and couldn't figure out how to autoresize the content of the cell between the small and large layout.

E.g. I have an UILabel within the CollectionViewCell which should be half the width of the cell at a defined (fixed) position. When the transition to the large layout is finished, the label should be also half of the cell (same relative position), but with a larger font size (or resized).

Use autolayout here or scale the contentView with CGAffineTransformMakeScale?

Any advice would be helpful .. ;)

Cancel transition

Hello again,

I have a situation where if i rotate my device while performing a layout transition the app errors with the following error:

the collection is already in the middle of an interactive transition

So I was wondering if there was a way I could cancel the transition if one was in progress?

UICollectionView not centering transition in iOS 9, worked fine in iOS 8.

The app essentially transitions between two different UICollectionViewFlowLayouts in a UICollectionView. I've not had a single problem with the TLLayoutTransitioning class prior to iOS 9. Thanks so much for taking the time to make and share this, by the way! It's a life saver. :)

For some reason since updating to iOS 9 (app still compiled for 8+) the transition doesn't center the offset, and instead seems to throw the whole transition off now while transitioning from large to small layouts, as seen here:

ripewellwornkagu-size_restricted

Any thoughts what might've changed?

pinch again during animation

Hello guys,

First of all thank you for this awesome library !

I have a crash in my app made after your pinch example. Basically if I pinch and let, there is a animation that continues until it stabilizes. If I pinch again during this animation I get an exception

2015-05-07 17:46:49.804 Tradee[4684:1227320] *** Assertion failure in -[UICollectionView _finishInteractiveTransitionShouldFinish:finalAnimation:], /SourceCache/UIKit/UIKit-3347.44/UICollectionView.m:2897
2015-05-07 17:47:03.124 Tradee[4684:1227320] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'the collection was not prepared for an interactive transition. see startInteractiveTransitionToCollectionViewLayout:completion:'

Any ideas on how to fix this ? Or maybe point me in the right direction ?

Thank you,
Adrian

Exception during pinch gesture handling.

When testing pinch gestures in rapid succession (aka toddler testing) I see the following exception raised.

2015-08-05 17:44:06.512 Examples[904:731529] *** Assertion failure in -[UICollectionView _finishInteractiveTransitionShouldFinish:finalAnimation:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3491.2.5/UICollectionView.m:2981
2015-08-05 17:44:20.445 Examples[904:731529] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'the collection was not prepared for an interactive transition. see startInteractiveTransitionToCollectionViewLayout:completion:'

I believe this reopens #17.

I encountered this on iOS 9 (13A4305g), but suspect that the issue can present itself on other versions as well.

Here is what I think might be going on:

  1. Disabling the pinch gesture recognizer in the pinch handling method is causing the handling code to be called twice so [self.collectionView finishInteractiveTransition] or [self.collectionView cancelInteractiveTransition] could get called while the transition to completion is already in flight.
  2. The logic in the pinch handling code is falling through to the final else clause in more situations than are likely intended. For example, if the pinch gesture state is UIGestureRecognizerStateChanged and self.transitionLayout == nil or pinch.numberOfTouches <= 1.

-[UICollectionViewTransitionLayout setToContentOffset:]: unrecognized selector

This library is super helpful! Thank you so much! But I'm getting this bug suddenly:

"[UICollectionViewTransitionLayout setToContentOffset:]: unrecognized selector sent to instance 0x146f8360"

Specifically my stack trace breaks at the following line in your example:

"layout.toContentOffset = toOffset;"

If I comment it out, everything works fine, except, obviously, I no longer get that awesome offset during transitions. The problem, as best as I can tell, is that the following line of code is returning a [UICollectionViewTransitionLayout] and therefore isn't being properly typed to your [TLTransitionLayout] subclass for some reason:

"TLTransitionLayout *layout = (TLTransitionLayout *)[collectionView transitionToCollectionViewLayout:toLayout duration:2 easing:QuarticEaseInOut completion:nil];"

When I NSLog the 'layout' object, it's definitely a [UICollectionViewTransitionLayout] type, not [TLTransitionLayout]. And, obviously, the [UICollectionViewTransitionLayout] class doesn't have the property "toOffset" I need, hence the error I'm experiencing. I've searched all over since this problem popped up over 9 hours ago, and zero solutions have helped. I've ensured all headers are included with #import and the implementation files are all being compiled within the correct target. I've cleared all my Derived Data, etc. Even uninstalled and reinstalled Xcode. I'm certainly lost. It just stopped working suddenly. I know it must be PEBKAC, but I can't for the life of me figure out how that can be. :( Anyhow, thanks a bunch for any insight. It was spectacular when it was working for me. :)

No source files in framework target.

The framework target needs to include the .m files.

Also, AHEasing needs to be added to Linked Frameworks and Libraries.

These changes are needed for the framework to be used with Carthage.

indexPath on Resize demo

Hi, Love your work mate.

The Resize example is giving an error on line 68 of the CollectionViewController when trying to set the property of 'keyIndexPath' which does not exist in the TLTrans header.

Does it simply need to be added?

Cheers!

layout transition for supplementary views

Hi Tim,

I'm currently making use of your TLLayoutTransitioning class and it is really easy to use! Thanks a lot for developing this! Actually, I encountered a problem with transition with supplementary views. In my project, instead of only one section, I have two sections in the collection view, and for each section, there is a header view and a footer view. However, after applying your resizing example, the header view and footer view are gone after doing a layout transition (animate cells to be bigger.) I don't think this is an issue with your implementation, but I just have no idea how to accommodate supplementary views in your example (Maybe there is a way to fix it easily which I'm not aware of.).
So, if at all possible, could you also add some header view/footer view in your resizing example so that I can study from it? I'm in desperate need of a way to make my project work...

Thanks a lot in advance!

Sincerely,

Frank

Jarring snap at end of interactive transition.

I've noticed a jarring snap to an unintended position when the user lifts their fingers, ending the pinch gesture. After the layout snaps to the unintended position it will animate back to the expected layout.

interactive_transition_snap

catch a error what it means?

*** Assertion failure in -[NSISLinearExpression incrementConstant:], /SourceCache/Foundation/Foundation-1047.25/Layout.subproj/IncrementalSimplex/NSISLinearExpression.m:620

Resize example crashes when double clicking a cell

Tim, thank you very much for building this. I'm playing around the resize example. When double clicking a cell, the program crashes. The error message is: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'the collection is already in the middle of an interactive transition'. I guess the beginIgnoringInteractionEvents and endIgnoringInteractionEvents calls should be added in collectionView:didSelectItemAtIndexPath:?

Memory leak

Hello, I am using your collectionview transition in my app and I appear to have a memory leak and xcodes profiler indicates it is here:

UICollectionViewTransitionLayout *transitionLayout = [self startInteractiveTransitionToCollectionViewLayout:layout completion:^(BOOL completed, BOOL finish) {
UICollectionViewTransitionLayout *transitionLayout = [self tl_transitionLayout];
if ([transitionLayout conformsToProtocol:@protocol(TLTransitionAnimatorLayout)]) {
idlayout = (id)transitionLayout;
[layout collectionViewDidCompleteTransitioning:self completed:completed finish:finish];
}
[self tl_setAnimationDuration:nil];
[self tl_setAnimationStartTime:nil];
[self tl_setTransitionLayout:nil];
[self tl_setEasingFunction:NULL];
if (completion) {
completion(completed, finish);
}
[[UIApplication sharedApplication] endIgnoringInteractionEvents];
}];

I am unsure of how to fix this, can you help?

Public Headers

When building the framework, the following headers aren't Public, Private or Project.

  • TLTransitionLayout.h
  • UICollectionView+TLTransitioning.h

This renders the .framework useless at the moment when built via Carthage (but I suppose that'd be the case for anything else as well)

Could you please include those headers in the framework as well. I've tried this locally but forgot to fork it and send a PR. If you'd like, I could do that tomorrow.

Examples not building

Many errors like Pods-TLIndexPathTools-prefix.pch:2:9: Could not build module 'UIKit' or CoreFoundation.h:11:10: Could not build module 'Darwin' occur when trying to run the Examples project for iOS 7.1 simulator in Xcode 5.1 (5B130a) straight from the repo, no modifications.

Disable bounce effect in interactive transitions

Hi!

There seems to be a bounce effect when you complete an interactive transition, I'd like to replace that by just decelerating to final position without bouncing.

You can check this effect in the Example project, if you pinch and release it'll complete the interactive transition with a bounce effect going a bit further than final progress in some cases.

The workaround I found is to subclass TLTransitionLayout and override the setProgress:time: method limiting values to 0..1

- (void)setTransitionProgress:(CGFloat)transitionProgress time:(CGFloat)time
{
    [super setTransitionProgress:MAX(0, MIN(transitionProgress, 1.f)) time:MAX(0, MIN(time, 1.f))];
}

This does get rid for the bounce effect (it's no longer visible to the user) but the transition still takes some time to complete because it thinks it's bouncing.

Any idea how can I solve this issue?

Thanks in advance,

Nicolás.

Transition crashes when the number of sections in the datasource increases

Hey Tim, thanks for creating this. It was working well for me when I had only one section in my collection view, but now with multiple sections I'm experiencing a crash during transitionToCollectionViewLayout:duration:easing:completion: that I wasn't experiencing with the stock setCollectionViewLayout:animated:completion: method.

The setup:
I have a collection view that supports a transition between a 1-wide grid layout and a 4-wide grid layout. The cells in the collection view are sectioned by month (Sept 2014, August 2014, ...) and the content is paginated such that when the user scrolls to the bottom new content is requested from my API and appended to my dataSource (currently just calling reloadData instead of performing any insertion updates).

Steps:

  1. Start with a 1-wide grid. Transition to a 4-wide grid. Technically there's still only 1 section at this point, because we're still in the first month of data.
  2. Scroll down a few pages in the 4-wide grid until we've reached the next section.
  3. Attempt to transition back to the 1-wide grid results in a crash at this line:
UICollectionViewLayoutAttributes *toPose = reverse
                    ? [self.currentLayout layoutAttributesForItemAtIndexPath:indexPath]
                    : [self.nextLayout layoutAttributesForItemAtIndexPath:indexPath];

Because self.nextLayout's layoutAttributesForItemAtIndexPath:indexPath returns nil when the section index > 0. The error is:

Uncaught exception: *** -[__NSArrayM objectAtIndex:]: index 1 beyond bounds [0 .. 0]

It appears that when I transition from the 1-wide layout, there's only one section in existence. Then, after scrolling the 4-wide layout, there's multiple sections. Attempting to go back to the 1-wide layout, the crash occurs.

If I scroll through many sections while in the 1-wide layout, and then scroll back up, I'm free to transition between layouts since the number of sections in the 1-wide layout is in sync with the number of sections in the 4-wide layout.

Any idea how to fix this? I'd very much like to continue using your library.

Thanks!

Hi Tim - I get this error on demo

the demo can't find TLCollectionViewController.

TLCollectionViewController', superclass of 'CollectionViewController'; did you mean 'UICollectionViewController'?

did this file get misplaced from repo?

Cheers
JP

Getting crash in pinch gesture after pagination

Hi ,

I'm getting crash when I try to use pics gesture after loading data using pagination. Initially it's working fine but when load data using pagination and try to using animation application get crashed. Below are the error message which I'm getting from Xcode
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Rounding frame ({{-8.9884656743115785e+307, -8.9884656743115785e+307}, {1.7976931348623157e+308, 1.7976931348623157e+308}}) from preferred layout attributes resulted in a frame with one or more invalid members ({{-inf, -inf}, {inf, inf}}). Layout attributes: <UICollectionViewLayoutAttributes: 0x1505aa6a0; index path: (30-0); frame = (-8.98847e+307 -8.98847e+307; 1.79769e+308 1.79769e+308); non-affine transform; alpha = -0.00456592> View: <GalleryApp.SelectPhotoCell: 0x150910920; baseClass = UICollectionViewCell; frame = (-8.98847e+307 -8.98847e+307; 1.79769e+308 1.79769e+308); transform3D = [-0.00456592, 0, 0, 0; 0, -0.00456592, 0, 0; 0, 0, -0.00456592, 0; 0, 0, 0, -0.00456592]; clipsToBounds = YES; alpha = -0.00456592; hidden = YES; opaque = NO; layer = <CALayer: 0x282e18f00>>'

Please let me know if we have any solution.

Podfile configuration for example

The TLLayoutTransitioning pod local path should be '../' insead of '..'

pod 'TLLayoutTransitioning', :path => '../'

Otherwise it gives me the following error

Fetching podspec for TLLayoutTransitioning from ..
[!] Unable to satisfy the following requirements:

  • TLLayoutTransitioning (from..) required by Podfile

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.