GithubHelp home page GithubHelp logo

rhodgkins / rdhcollectionviewgridlayout Goto Github PK

View Code? Open in Web Editor NEW
160.0 160.0 26.0 436 KB

Grid layout for UICollectionView

License: Other

Objective-C 97.57% Ruby 2.43%
grid-layout ios objective-c uicollectionview

rdhcollectionviewgridlayout's People

Contributors

rhodgkins avatar robmaceachern 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

rdhcollectionviewgridlayout's Issues

Set section insets?

Is there a way to set section insets? I notice the the class is not a subclass of UICollectionViewFlowLayout so I'm not sure how this would be achieved.

Full Horizontal Scroll

I know this is an issue with UICollectionView and not your Layout, but is there a way to use horizontal scroll with your layout and get the data to show up like this:
[0] [1] [2] | [6] [7] [8]
[3] [4] [5] | [9]

instead of:
[0] [2] [4] | [6] [8]
[1] [3] [5] | [7] [9]

EXC_ARITHMETIC error

I'm getting an EXC_ARITHMETIC error (division by 0) when reloading a CollectionView using RDHCollectionViewGridLayout

Error Line:

frame = [self.firstLineFrames[indexPath.item % self.lineItemCount] CGRectValue];

Variables:

(lldb) po self
<RDHCollectionViewGridLayout: 0x7a74cbe0; scrollDirection = Vertical; lineDimension = (Size, 0.000); lineItemCount = 0; itemSpacing = 10.000; lineSpacing = 10.000; sectionsStartOnNewLine = YES>

(lldb) po indexPath
<NSIndexPath: 0x7a637a30> {length = 2, path = 0 - 0}

Stack:

* thread #1: tid = 0x538888, 0x00122388 imgur`-[RDHCollectionViewGridLayout calculateLayoutAttributesForItemAtIndexPath:](self=0x7a74cbe0, _cmd=0x001514a5, indexPath=0x7a637a30) + 312 at RDHCollectionViewGridLayout.m:341, queue = 'com.apple.main-thread', stop reason = EXC_ARITHMETIC (code=EXC_I386_DIV, subcode=0x0)
    frame #0: 0x00122388 imgur`-[RDHCollectionViewGridLayout calculateLayoutAttributesForItemAtIndexPath:](self=0x7a74cbe0, _cmd=0x001514a5, indexPath=0x7a637a30) + 312 at RDHCollectionViewGridLayout.m:341
  * frame #1: 0x001209a8 imgur`-[RDHCollectionViewGridLayout prepareLayout](self=0x7a74cbe0, _cmd=0x013ed93f) + 536 at RDHCollectionViewGridLayout.m:103
    frame #2: 0x011d70d2 UIKit`-[UICollectionViewData _prepareToLoadData] + 76
    frame #3: 0x011d78e0 UIKit`-[UICollectionViewData validateLayoutInRect:] + 68
    frame #4: 0x011973a3 UIKit`-[UICollectionView layoutSubviews] + 171
    frame #5: 0x00b007b1 UIKit`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 608
    frame #6: 0x020c4771 libobjc.A.dylib`-[NSObject performSelector:withObject:] + 70
    frame #7: 0x050b31cf QuartzCore`-[CALayer layoutSublayers] + 152
    frame #8: 0x050a7055 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 397
    frame #9: 0x050a6eb0 QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 26
    frame #10: 0x050051b6 QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 284
    frame #11: 0x0500658a QuartzCore`CA::Transaction::commit() + 392
    frame #12: 0x05006c56 QuartzCore`CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
    frame #13: 0x0234818e CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
    frame #14: 0x023480d0 CoreFoundation`__CFRunLoopDoObservers + 400
    frame #15: 0x0233db0a CoreFoundation`__CFRunLoopRun + 1226
    frame #16: 0x0233d37b CoreFoundation`CFRunLoopRunSpecific + 443
    frame #17: 0x0233d1ab CoreFoundation`CFRunLoopRunInMode + 123
    frame #18: 0x04f6a2c1 GraphicsServices`GSEventRunModal + 192
    frame #19: 0x04f6a0fe GraphicsServices`GSEventRun + 104
    frame #20: 0x00a749b6 UIKit`UIApplicationMain + 1526
    frame #21: 0x000dc13d imgur`main(argc=1, argv=0xbff265d8) + 141 at main.m:14
    frame #22: 0x029fcac9 libdyld.dylib`start + 1

Add UI tests

Xcode 7 introduced UI testing - use this to test scrolling and invalidation.

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.