Coder Social home page Coder Social logo

rbcollectionviewinfofolderlayout's People

Contributors

bryant1410 avatar eoghain avatar rrossinvicara 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rbcollectionviewinfofolderlayout's Issues

Fresh reload to default state

Hi there - nice tool by the way...

I'm struggling with an implementation and hoping you can help...

I have about 9-10 sections each with their own .json file and selected from a different view. I have all the data loading fine and all looks good. Until I choose another section from a separate view having left one of the folders open. The folder itself collapses away, but the folder view remains and if just try to load the data into the open view it doesn't always format properly.

I only have one section per view with multiple cells / folders in that view. e.g. The menu calls the collection view to display data based on a NSNotification it receives - which all works fine with the exception of an open folder not closing if left open when a new notification id received. And as much as I have tried I can't seem to call that folder to close either in the notification or in the collection view.

Is there a way to use the closeAllOpenFolders or anything else when viewing a new data view or when leaving an existing view to force any open folders to close? Exactly like it does when selecting different cells within the same section in the demo.

Thanks!!

Explanation needed for toggleFolderViewForIndexPath

The following function is in the file RBCollectionViewInfoFolderLayout.m:


- (void)toggleFolderViewForIndexPath:(NSIndexPath *)indexPath
{
    NSIndexPath * visibleFolder = self.visibleFolderInSection[@( indexPath.section )];
    NSInteger selectedFolderRow = [self rowForIndexPath:indexPath];
    NSInteger openFolderRow = (visibleFolder) ? [self rowForIndexPath:visibleFolder] : selectedFolderRow;

    if ([visibleFolder isEqual:indexPath])
    {
        [self.visibleFolderInSection removeObjectForKey:@( indexPath.section )];
    }
    else
    {
        self.visibleFolderInSection[@( indexPath.section )] = indexPath;

        UICollectionViewLayoutAttributes * attributes = self.layoutInformation[RBCollectionViewInfoFolderFolderKind][indexPath];
        CGRect scrollFrame = attributes.frame;
        scrollFrame.origin.y += attributes.frame.size.height;
        scrollFrame.size.height = 5;
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [self.collectionView scrollRectToVisible:scrollFrame animated:YES];
        });
    }

    // If we are opening a row below an already open row reload the visible item
    if (selectedFolderRow > openFolderRow)
    {
        [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:visibleFolder.section]];
    }
    else // reload the selected item
    {
        [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:indexPath.section]];
    }
}

Can somebody please explain it to me line by line because for me this reloadSections part is reloading all my data over the previous data i.e. overlapping the data once from index 0 to n and vice versa every time I open a folder layout.

[Question] UITableView?

Hello. Please try and find it to excuse me for opening an issue for something I'd make rather as a question. I could not find any other means of contacting the developer.
I'd like to see how I might use this to implement a UITableView into a selected folder.
Similar to how iTunes 11 does in their stock application and quite possibly resizing the folder based on the UITableView's size?
screen shot 2014-08-18 at 12 37 04 pm

Again, I really appreciate your project! You sure know a lot about! I just wanted to pick your brain for adding a UITableView to a folder view before I botch up a crappy implementation of the idea I am going for.

Thanks.

Speed when scrolling

I find that when I use this code with a bunch of items (like hundreds), scrolling is incredibly slow. Is this a problem with the custom layout?

Demo application not running

I'm trying to run the demo application, when I do this I get the following error

RBCollectionViewInfoFolderLayout[19992:1154545] [/BuildRoot/Library/Caches/com.apple.xbs/Sources/CoreUI_Sim/CoreUI-371.4/Bom/Storage/BOMStorage.c:507] stream invalid; root page is outside of address range
2016-02-12 19:16:47.198 RBCollectionViewInfoFolderLayout[19992:1154484] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCache setObject:forKey:cost:]: attempt to insert nil value (key: http://i.annihil.us/u/prod/marvel/i/mg/2/d0/4bc6815155c10/portrait_incredible.jpg)'
*** First throw call stack:
(
0 CoreFoundation 0x0000000109a20e65 exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000109499deb objc_exception_throw + 48
2 CoreFoundation 0x000000010993c581 -[NSCache setObject:forKey:cost:] + 401
3 RBCollectionViewInfoFolderLayout 0x000000010781276a __56-[ViewController collectionView:cellForItemAtIndexPath:]_block_invoke_2 + 106
4 libdispatch.dylib 0x000000010a47249b _dispatch_client_callout + 8
5 libdispatch.dylib 0x000000010a45bc3c _dispatch_barrier_sync_f_slow_invoke + 284
6 libdispatch.dylib 0x000000010a47249b _dispatch_client_callout + 8
7 libdispatch.dylib 0x000000010a45a2af _dispatch_main_queue_callback_4CF + 1738
8 CoreFoundation 0x0000000109980d09 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
+ 9
9 CoreFoundation 0x00000001099422c9 __CFRunLoopRun + 2073
10 CoreFoundation 0x0000000109941828 CFRunLoopRunSpecific + 488
11 GraphicsServices 0x000000010c79ead2 GSEventRunModal + 161
12 UIKit 0x0000000107b06610 UIApplicationMain + 171
13 RBCollectionViewInfoFolderLayout 0x000000010781c00f main + 111
14 libdyld.dylib 0x000000010a4a692d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

I'm also wondering how can I implement this when I already have made a custom cell myself with a .xib file? I'm not that experienced with swift/objective c(I'm using swift) so I'm having trouble implementing it.

Dimple is getting hide

Sometime randamly the dimple is getting hide automatically.please suggestions me the reason.

CALayer position contains NaN: [nan 222.5]

when I first ran this demo, I get this error.

Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan 222.5]'

How to fixe this? Thx!

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.