Giter Club home page Giter Club logo

tglstackedviewcontroller's People

Contributors

dulacp avatar ewg777 avatar gleue avatar hannesoid avatar mrtristan avatar zhukn1 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

tglstackedviewcontroller's Issues

Cell alignment

I would like to know if there are only two cell, how can I make the cell stacked over another cell (like the image on right hand side), what I got now is distributed evenly in the collection view (see the image on left hand side)

1

Subclassing UIViewController instead of UICollectionViewController

Would you be opposed to a Pull Request which turns TGLStackedViewController into a subclass of UIViewController rather than a UICollectionViewController?

The benefit of this will be that subclasses could then easily manage additional subviews (such as an index-scrubber)

Child Controller

I want to use this controller as a child of a container controller. I already have a view controller to manage a view I want to show this TGLStackedView control on. However, I can't seem to get it to work as a child controller. Any idea how to do this?

Expanding a cell taking time

in this method
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:
(NSIndexPath *)indexPath {
if (self.exposedItemIndexPath && indexPath.item == self.exposedItemIndexPath.item) {
self.exposedItemIndexPath = nil;
}
else {
NSLog(@"Hello1");
self.exposedItemIndexPath = indexPath;
NSLog(@"Hello2");
}

when i am assigning exposedItemIndexPath its taking almost 5 to 6 seconds to expand a cell.

Can you please help me to improve this ?

Getting error collection view layout

When I run an application after implement get error
"Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'TGLStackedViewController collection view layout is not a TGLStackedLayout' "
I don't understand what's going wrong

iOS8 collapse issue

ios8 collapse

You can see during collapse, it suddenly move up and then back to normal.

topReveal not being respected.

I have tried to set a custom 'topReveal' height, but it is never changed:

    self.stackedLayout.topReveal = 50.0

Any ideas why?

Tappable area of stacked view not obeying visual zIndex

When calling func moveItemAtIndexPath(indexPath: NSIndexPath, toIndexPath newIndexPath: NSIndexPath)the zIndex of the cards looks good visually, but very often I notice that tapping on a card will result in the card behind in the stack responding to the tap instead.

I noticed that opening up the Interface Inspector in Xcode reveals that the zIndex of the views themselves are infact incorrect. Even though it looks perfect on the simulator and a device.

After doing some research I've discovered that the zIndex of a layer doesn't infact modify the response order of the cells in regards to which cell is on top when a tap event is trigger. Modifying the zIndex instead only visually changes the zIndex of the layer.

I've been working on trying to fix this for a few days. Do you have any ideas on how to fix this issue?

How to get real contentSize?

Hi,

Thanks for such a great lib!

How to get real height of the content without filling and so on?

Here is an example but it doesn't work properly with you lib. Do you have any idea? @gleue

class MyCollectionView: UICollectionView {
    // MARK: - Layout
    override func layoutSubviews() {
        super.layoutSubviews()

        let height = contentSize.height
        guard
            height > 1 else {
                return
        }
// here the height
    }
}

P.s. I'd like to use two instances of the lib on a page.

Regards,

Switching between stacked layout and flow layout

Hi, first I'd like to congratulate you for the awesome control !!
In my app I'm trying to show all items in full size when one of them is tapped. I achieved the desired effect using UICollectionViewFlowLayout instead of TGLExposedLayout when one of the items is selected. But when I deselect it, switching back to TGLStackedLayout, the collection view is scrolled to a different position to what is expected and in most of times the item below the deselected item is missing, so I have to scroll the missing item off the screen to bring it back.

Does anyone have an idea to what could I do to fix it?

Card size

We have to notice content inset when calculate card size for exposed layout:

CGSize cardSize = CGSizeMake(
CGRectGetWidth(self.collectionView.bounds) - self.layoutMargin.left - self.layoutMargin.right, 
CGRectGetHeight(self.collectionView.bounds) - self.layoutMargin.top - self.layoutMargin.bottom - self.collectionView.contentInset.top);

It's helpful in case we use our controller inside UINavigationViewController for example

ios 11 dragitems

hi gleue,

im update my tglstackedviewcontroller with new version 2.2.2
but i got problem with new behavior in 2.2.2.
when i drag item it shrink when moving the drag item.
so can u tell me where should i change the code to make the drag item just like previous behavior (like version 2.0)

Thank you

Crash if tap on a card just after the release scroll.

Tap on a card to see exposed view. Scroll up down (Pan gesture) in a way the [self.collectionView cancelInteractiveTransition]; been called from handleCollapsePanGesture: case UIGestureRecognizerStateEnded. Just a that movement tap on the exposed card. App crashes with the below logs.

2016-08-03 19:25:03.766 TGLStackedViewExample[358:20875] -[TGLStackedLayout setTransitionProgress:]: unrecognized selector sent to instance 0x125f176f0
2016-08-03 19:25:03.768 TGLStackedViewExample[358:20875] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[TGLStackedLayout setTransitionProgress:]: unrecognized selector sent to instance 0x125f176f0'
*** First throw call stack:
(0x180b76db0 0x1801dbf80 0x180b7dc4c 0x180b7abec 0x180a78c5c 0x18651d538 0x18651dfe8 0x185f436d0 0x185f43434 0x18154d038 0x180b2d794 0x180b2d438 0x180b2ab4c 0x180a54c50 0x18233c088 0x185d3e088 0x10008390c 0x1805f28b8)
libc++abi.dylib: terminating with uncaught exception of type NSException

How to add a title similar to Wallet app ?

I love this stacked view controller that you build. I am interesting to make something similar to Wallet app and I want to add a title on the top.

Can you give me some pointers on how to do this ?
I am thinking that the Wallet app title might be a Section Header ? If so I need to implement this in the StackLayout class (and ExposedLayout ? ). Also I need it to stop at the top while scrolling and all cells go above it. Not sure if this will work automatically or I need to make changes.

What do you thing ?

Adrian

How can I disable cards pop-up

Hi, everything is working well, but in my app I need to disable card's pop up animation, when click on it appears.
Can I somehow disable this animation?

ios6 and ios6.1 running effect

This project support ios6 and ios6.1 ,bug the running effect is different from ios7 above? In ios6 adn ios6.1 ,It can launch but it can't take back.

Item size

Setting the item's size, on selection, exposes not only the selected card.
Also, when deselecting it, it scrolls offscreen. This was reproduced in the example project only by setting the item size.

Issue with stacked layout location

Hi,

I have added your great work TGLstackedView to my app and it looks great ... but it has one strange issue ... I spend hours to fix it without hope...

1- When view appeared the position of cards is not correct based on giving information (is suppose to be 10 from top of collectionView) .... - even if tried to push the cards to top it stacked at same location-
2016-12-27-photo-00000062

2- When I exposed any items it will shows at same wrong location ... same as above
2016-12-27-photo-00000063

3- but when I click on unexposed items ... it will show all items but in CORRECT location ... to (10)
2016-12-27-photo-00000065

and also it even can scroll to down and up !!

I have spend hours to check parameters to control this behavior ... and tried to test example app .. but I could not solve my issue because in example app when you click on unexposed items is not behaving any thing "No gesture"

Note: I am using 100% code as i am not familiar with IB Story board

        let layout: TGLStackedLayout = TGLStackedLayout()            
        layout.itemSize = CGSize(width: view.bounds.width - 20, height: view.bounds.height-250)
        layout.layoutMargin = UIEdgeInsetsMake(10, 0, 0, 0);  //this is edge from collectionView "Gray Color"
        layout.topReveal = 50

self.collectionView?.frame = CGRect(x:0, y:80, width: self.view.bounds.width, height: self.view.bounds.height-130)
self.exposedPinningMode = .all
self.exposedItemSize = CGSize(width: view.bounds.width - 20, height: view.bounds.height-200)
self.exposedLayoutMargin = UIEdgeInsetsMake(10, 0, 0, 0);
self.exposedBottomOverlap = 25
self.view.backgroundColor = .red

Thank you

flowdelegatelayout method not called

Hi,

Great library first of all :) it looks fantastic.

I was getting issues in ios9 with constraints involved.. so i tried setting flowlayout delegate method.. but strangely that's not getting called?..

I tried setting it in both the inherited class as well as in TGLStackedViewController.. but both approaches did not work.. any help would be appreciated.. Thanks !!

Adding contentInset to top?

Thank you for a great project!
Now use it in development, already added some features like different topReveal and sizes for cells at specific index path. But i got stucked, when i tried something like contentInset in UIScrollView.
If I change layoutMargin of stackedLayout it changed the scroll frame, but doesn't give me the contentInset for cells.
I hope you understand the problem and can give and advise or make some key to solve it.

The only solution I know is to make the first cell transparent, but it will outcome in reindexing all dataSource. And this is not the perfect idea.

Could you make MOVE_ZOOM into a property?

First of all, thank you for a great control. Saved me a lot of time of coding something similar myself.

So, is there any particular reason why the MOVE_ZOOM value is defined in a macro in stead of being a configurable property like almost everything else?
In my case I want to actually zoom in when moving a card (i.e. make the view larger then the cell in stead of smaller). Right now I have manually added the classes to my project and changed the macro to 1.05 in stead of 0.95, but I would really like to avoid this since I prefer using CocoaPods.

Refreshing stack when adding new item

Whenever i am adding new items to stack view, entire view is refreshing. SO when i have card in expanded state and in background if any new items gets added. Entire cards are getting refreshed and back to default state.

Need help with this issue.

why is ios7 required?

i just pulled this down and changed the deployment target to iOS6.1(my minimum) and it seems to fully function. is there something that i'm missing? could you drop the requirement to 6.0 or 6.1?

if there are any requirements of iOS 7 that i'm not seeing then I'd be willing to help and submit a pull request to expand support to iOS 6.1 if you just point out the requirements to me.

Give space between cells

How can i give few pixel space between each cell ? And from bottom to top cells.. width should decreased... how can i achieve this ?

Make the bottom most card also visible in full length

Hi @gleue,

I want one more help again :)

Currently when you have many stacked cells, if you scroll down to the bottom, you can only see a part of the bottom most card.. if you try scrolling to the limit, you can see a part of it..

is it possible to see the last card in full? i hope you get my point..

Set cell height

I'd like to set the height of the first cell higher than the others, as below image shows, how can I achieve this?

cards

Constraints break in ios9

Okay..

So for our project we used TGLStackedViewController and all are happy with the animation and outcome.. except when iOS9 came out. In iOS9, for some reason, not always, the constraints inside a cell breaks and all the subviews come together (not for all cells)

I must admit that I had added some changes to the TGLStackedViewController.m file.. so as to suit the project needs. I can brief the changes that i have made :

-> i change the collectionView frame to position it a bit higher (I have added like a view with buttons above the Collectionview, to act like a fixed header.) - This happens inside an animation, when a user clicks on a cell.. So in effect though the collection view doesn't stand at the top of the screen on launching, when i click on a cell, it goes all the way up.
-> i push a ViewController on the ending of the card swipe up animation; That is, when a user clicks a cell, and it gets animated to the top and the rest of the cards go down, i push a ViewController that has the exact look and feel of the Collectionview cell.
-> from this new viewController, on a button action, a pop this view and the raised card slides back into the stack..

It looks awesome in ios8!!

But in iOS9, when we play with tha animations, at some point, for some cells, the constraints break..

I cannot blame TGLStack because this issue doesn't happen when i don't push the viewcontroller.. but since it doesnt happen to OS prior to iOS9.. I am desperately searching for a solution..

I am writing to you so as to get a sense of direction.. :) Some inputs from you can maybe help me sort out things.. Please help!!!

slowness with 30+ elements

Hello, I noticed that with 30+ elements the TGLStackedViewController doesn't respond very well (animations aren't fluid)

Do you have any idea to fix this?

Thanks,
Andrea

TGLStackedViewController in Container View adds extra top margin, can't get rid of it.

Not sure if this is a problem with the library or just in general, but since I want to have some custom UI above/below the stacked view, I embed it inside a container view instead, but keep getting an extra ~50pts of top margin in the stacked view. Here is my basic setup:

override func viewDidLoad() {
    super.viewDidLoad()
    self.automaticallyAdjustsScrollViewInsets = false
    self.unexposedItemsAreSelectable = true
    self.stackedLayout.alwaysBounce = true
    self.stackedLayout.layoutMargin.top = 0.0
    self.stackedLayout.topReveal = DNDarePackCellCompactHeight
    self.exposedTopOverlap = DNDarePackCellCompactHeight
    self.collectionView?.contentInset = UIEdgeInsetsZero
}

And yes, ensured all auto layout constraints are correct. Right now there is a simple UILabel at the top of the main view controller (UIViewController), then the Container View (with embedded UICollectionViewController of a subclassed TGLStackedViewController) is flush at the bottom of that. The label is only 32.0pts in height, but the stacked view's first card is about ~80pts below it. One thing I do notice is that as I swipe the cards up, they do move up to the correct position. It seems like its just some weird inset/margin that is being set on the first card somehow.

Any suggestions?

Embed in ViewController

Is there anyway to use this class in a UIViewController? It looks like it's only built to be used as a subclass of a UICollectionViewController. I was hoping to use it as a collectionview inside of my UIViewController subclass with that subclass set as the delegate/datasource

Selector of UIButton is not calling

I've added the UIButton and assigned it's selector but whenever i clicked on button Card gets closed instead of calling UIButton selector.

About adding footer

The project gives a great interface!
and I'm trying coding on it. It's great to have toolbar and navigation bar in the new release. and I tried to add a footer in the collectionview, and also a subclass "footerview" for it. it shows on the storyboard, but it refused to show anything when ran. Any Suggestion?

Thx!

An exception occurs under the iOS11

Thank you very much.
Although I didn't use your framework directly, but I really got a lot of inspiration form them.

But now, under the iOS 11 system, I set zIndex and set transform for the attributes in the
- (UICollectionViewLayoutAttributes *)layoutAttributesForInteractivelyMovingItemAtIndexPath:(NSIndexPath *)indexPath withTargetPosition:(CGPoint)position
it doesn't work..

I'm not sure it's the bug of the iOS11, but it's been bothering me for days...

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.