ashfurrow / arcollectionviewmasonrylayout Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Something that would sit under the header, but then will scroll until it's at the top.
Could also provide a callback for when the view is 'stuck'.
The first ever CI build in over a year has failed to run. Looks like a problem installing Ruby dependencies.
Hey @ashfurrow @orta !! I here again! ๐
There is some example in swift to create Sticky Headers in collectionview use this framework ARCollectionViewMasonryLayout
?
I'll take a look at this when I can.
Should be able to add an arbitrary header and/or footer view above the masonry layout via supplementary views.
Currently requires bundler and cocoapods, neither of which is specified in the readme. Checking in the Pods directory would probably be the easiest thing.
This project needs tests and Travis-CI. Consider https://github.com/facebook/ios-snapshot-test-case or https://github.com/dblock/ios-snapshot-test-case-expecta to take snapshots of views and compare.
Some projects that use the above: https://github.com/dblock/ARTiledImageView and https://github.com/dblock/ARASCIISwizzle
This line is problematic, since count
returns a NSUInteger
, count - 1
yields 18446744073709551615 on a 64 bit processor.
XCode6/iOS8 only, scrolling all the way down in the demo project:
2014-06-10 14:19:47.275 Demo[16513:901601] *** Assertion failure in -[ARCollectionViewMasonryLayout _decorationViewForLayoutAttributes:], /SourceCache/UIKit_Sim/UIKit-3185.20/UICollectionViewLayout.m:1302
2014-06-10 14:19:47.278 Demo[16513:901601] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'could not dequeue a decoration view of kind: UICollectionElementKindSectionFooter - must register as a class or nib or connect a prototype in a storyboard'
*** First throw call stack:
(
0 CoreFoundation 0x01bb6916 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x018548d9 objc_exception_throw + 44
2 CoreFoundation 0x01bb67aa +[NSException raise:format:arguments:] + 138
3 Foundation 0x014d567c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 118
4 UIKit 0x007c74ee -[UICollectionViewLayout _decorationViewForLayoutAttributes:] + 974
5 UIKit 0x007a4aae -[UICollectionView _createPreparedSupplementaryViewForElementOfKind:atIndexPath:withLayoutAttributes:applyAttributes:] + 469
6 UIKit 0x007a62e2 -[UICollectionView _updateVisibleCellsNow:] + 4928
7 UIKit 0x007aa36f -[UICollectionView layoutSubviews] + 263
8 UIKit 0x00122223 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 601
9 libobjc.A.dylib 0x01867763 -[NSObject performSelector:withObject:] + 70
10 QuartzCore 0x032b1b87 -[CALayer layoutSublayers] + 152
11 QuartzCore 0x032a59e9 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 397
12 QuartzCore 0x032a5844 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
13 QuartzCore 0x03206b1e _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 284
14 QuartzCore 0x03207ee4 _ZN2CA11Transaction6commitEv + 392
15 QuartzCore 0x032da222 _ZN2CA7Display11DisplayLink14dispatch_itemsEyyy + 470
16 QuartzCore 0x032da65f _ZN2CA7Display16TimerDisplayLink8callbackEP16__CFRunLoopTimerPv + 123
17 CoreFoundation 0x01b125d6 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
18 CoreFoundation 0x01b11f5d __CFRunLoopDoTimer + 1309
19 CoreFoundation 0x01acf66a __CFRunLoopRun + 2090
20 CoreFoundation 0x01aceb7b CFRunLoopRunSpecific + 443
21 CoreFoundation 0x01ace9ab CFRunLoopRunInMode + 123
22 GraphicsServices 0x02de8500 GSEventRunModal + 192
23 GraphicsServices 0x02de833d GSEventRun + 104
24 UIKit 0x0009ddee UIApplicationMain + 3727
25 Demo 0x0000268d main + 141
26 libdyld.dylib 0x064a7ac5 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Is this line correct? Always returning height
https://github.com/AshFurrow/ARCollectionViewMasonryLayout/blob/master/ARCollectionViewTest/ARCollectionViewMasonryLayout.m#L367
Somehow Travis seems to be disabled for this project. My PR ain't building...
https://travis-ci.org/AshFurrow/ARCollectionViewMasonryLayout/
Since this code was taken out of the Artsy codebase and originally written by @orta, lets make copyright Ash Furrow, Orta Therox and Artsy. There's at least the mention in the LICENSE file.
Why the layout is asking for a reusable view for kind ARCollectionElementKindSectionStickyHeader
if I never registered it to my collection or implemented the - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForStickyHeaderInSection:(NSInteger)section;
method?
The docs in the README appear to be out of date. I can't seem to find any references to the method - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(ARCollectionViewMasonryLayout *)collectionViewLayout dimensionForHeaderAtIndexPath:(NSIndexPath *)indexPath
anywhere in the current version of the code.
Is there no longer support for header/footer views, or is there now a different way to add them?
The name "ARCollectionViewTest" is confusing, cause this is a demo rather than a test. It should probably just be called "Demo".
2016-02-20 12:00:17.462 EmbedInExistingNavigationStack[49301:19970305] *** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [288.5 nan]'
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.