GithubHelp home page GithubHelp logo

coeur / collectionviewcenteredflowlayout Goto Github PK

View Code? Open in Web Editor NEW
111.0 111.0 20.0 73 KB

A layout for UICollectionView that aligns the cells to the center.

License: MIT License

Ruby 9.97% Swift 90.03%

collectionviewcenteredflowlayout's People

Contributors

coeur avatar jakubmazur avatar mohpor 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

collectionviewcenteredflowlayout's Issues

Xcode 14 Build Error: The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions

Building with Xcode 14 (beta) results in error:

The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions

image (2)

There is one operation above threshold so to fix it it's enough to split most complex expression into:

let evaluatedCollectionView = (collectionView.bounds.height + evaluatedSectionInset.top - evaluatedSectionInset.bottom - group.reduce(0, { $0 + $1.frame.size.height }) - CGFloat(group.count - 1) * evaluatedMinimumInteritemSpacing)
var origin = evaluatedCollectionView / 2

Exception 'NSInternalInconsistencyException', reason: 'negative sizes are not supported in the flow layout'

2022-05-12 10:11:57.983617+0300 Planto[47691:3884672] *** Assertion failure in -[CollectionViewCenteredFlowLayout.CollectionViewCenteredFlowLayout _getSizingInfosWithExistingSizingDictionary:], UICollectionViewFlowLayout.m:1501
2022-05-12 10:11:58.005042+0300 Planto[47691:3884672] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'negative sizes are not supported in the flow layout'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff20406d44 __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x00007fff201a4a65 objc_exception_throw + 48
	2   Foundation                          0x00007fff2075e634 _userInfoForFileAndLine + 0
	3   UIKitCore                           0x00007fff24727647 -[UICollectionViewFlowLayout _getSizingInfosWithExistingSizingDictionary:] + 2971
	4   UIKitCore                           0x00007fff24728cbd -[UICollectionViewFlowLayout _fetchItemsInfoForRect:] + 228
	5   UIKitCore                           0x00007fff24721eb5 -[UICollectionViewFlowLayout collectionViewContentSize] + 48
	6   UIKitCore                           0x00007fff2471b2be -[UICollectionViewData _validateContentSize] + 72
	7   UIKitCore                           0x00007fff2471b477 -[UICollectionViewData _prepareToLoadData] + 211
	8   UIKitCore                           0x00007fff2471c2b5 -[UICollectionViewData validateLayoutInRect:] + 51
	9   UIKitCore                           0x00007fff246db9f1 -[UICollectionView layoutSubviews] + 229
	10  UIKitCore                           0x00007fff2565a2b0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2496
	11  QuartzCore                          0x00007fff28a6639d _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 543
	12  QuartzCore                          0x00007fff28a71583 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 65
	13  QuartzCore                          0x00007fff289937c9 _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 623
	14  QuartzCore                          0x00007fff289cae86 _ZN2CA11Transaction6commitEv + 774
	15  UIKitCore                           0x00007fff250c18e7 _afterCACommitHandler + 105
	16  CoreFoundation                      0x00007fff2037267d __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
	17  CoreFoundation                      0x00007fff2036ce41 __CFRunLoopDoObservers + 570
	18  CoreFoundation                      0x00007fff2036d3d9 __CFRunLoopRun + 1100
	19  CoreFoundation                      0x00007fff2036ca90 CFRunLoopRunSpecific + 562
	20  GraphicsServices                    0x00007fff2cb72c8e GSEventRunModal + 139
	21  UIKitCore                           0x00007fff2508e90e -[UIApplication _run] + 928
	22  UIKitCore                           0x00007fff25093569 UIApplicationMain + 101
	23  Planto                              0x0000000100b1e0df main + 63
	24  dyld                                0x00000001029dbf21 start_sim + 10
	25  ???                                 0x000000010d8cc51e 0x0 + 4522296606
)
libc++abi: terminating with uncaught exception of type NSException
dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLD_LIBRARY_PATH=/Users/vzool/Library/Developer/Xcode/DerivedData/Planto-anhibdxjncrzgscnrrnkzbfisflz/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMainThreadChecker.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMTLCapture.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib DYLD_FRAMEWORK_PATH=/Users/vzool/Library/Developer/Xcode/DerivedData/Planto-anhibdxjncrzgscnrrnkzbfisflz/Build/Products/Debug-iphonesimulator
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'negative sizes are not supported in the flow layout'
terminating with uncaught exception of type NSException
CoreSimulator 802.6 - Device: iPhone SE (3rd generation) (61A2DCE0-FFEF-4691-B84A-74FECB6F501E) - Runtime: iOS 15.4 (19E240) - DeviceType: iPhone SE (3rd generation)

Xcode 14 System.name fails due to null-terminated strings

Hi all, in Xcode 14, cStrings are required to be null-terminated. Because this was changed, apps with Xcode 14 targeting any version of iOS now fail at launch. I have fixed this and will link a PR in a moment

EDIT: wrong Github Repo, sorry

Compile errors on Xcode 14

Several occurrences of
Type of expression is ambiguous without more context
and
The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
errors occur when compiling in Xcode 14

No issue, just a thanks!

This was nice and easy to use. I thought I'd pass along my revisions, not that any of it is necessary, mostly it was just my way of working through what you had done. But since I appreciate your work, I thought I'd pass it along:

<script src="https://gist.github.com/chrisbrandow/00a234e7768616fb198353f833b0a8b7.js"></script>

Cocoapods Podspec needs updating (1.0.4)

Hi, thanks for the great library by the way. Could you please update the podspec so we can update to 1.0.4 with a simple pod update CollectionViewCenteredFlowLayout?

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.