vinnyoodles / mosaic-layout Goto Github PK
View Code? Open in Web Editor NEWA mosaic collection view layout inspired by Lightbox's Algorithm, written in Swift ๐ถ
License: MIT License
A mosaic collection view layout inspired by Lightbox's Algorithm, written in Swift ๐ถ
License: MIT License
layout loses bounds and thumbnails overlay each other after upgrading to iOS 14
Hi there,
I am sorry, to maybe ask a stupid question.
I've installed all proberly. The demo is running nicely with the Asset book images. (y)
Now my problem:
I installed TRMosaikLayout
by cocoapods. I am using XCode8 beta6.
I copied the TRCollectionViewController
code into an empty UICollectionViewController
class.
I added a UICollectionViewController
onto my storyboard
I changed the reuseIdentifier
to the proberly name
Added the Assets
you provide in your example
I changed the cell color
to any color (for testing)
Run the project, but cellForItemAt indexPath
was never called.
After a few hours of doom, I commented out the
` // self.collectionView!.collectionViewLayout = mosaicLayout`
Now it shows me the cells regularly. But not as Mosaiks. When I comment in this line, the mosaiklayout stays empty.
The cellForItemAt indexPath
function don't get called.
Many thanks in advance
Hi, I have a bug when I configure a grid with only small items. Somehow the end of the collectionview is not calculated correctly.
This is the grid scrolled down:
But there are 3 items incorrectly still below the fold. I can see them when I pull the CollectionView up:
My grid has 15 cells and it behaves like this with every number that can be divided by 3. When I add 1 big cell it works. The ViewController is a loaded from a Storyboard.
Any ideas what is wrong?
Hello, found that problem, what is this? my mistake? Scrolling just stop, if there big one cell without 2 small, but i can see it while bouncing collectionview
I like your job, and want to implement in my project, but does it work only with even counts of items?
Hi,
Your library is great! Just found out that collection view isn't scrolling to the last item if the item count is not divisible by 3..it happens in your example code too..
Could you please fix it?
Thanks
Hey, I'd love to see this lib available in Swift 3 so I can implement it in my project.
Thanks ๐
Does this support horizontal scrolling? I tried to set this in the CollectionView in Storyboard but no luck. Thanks.
Anyone else have trouble adding collectionview headers with the Mosaic Layout?
I was watching the latest WWDC and they had a section called "A Tour of UICollectionView". In this section, the instructor creates a mosaic layout like yours by creating a subclass of UICollectionViewLayout just like TRMosaicLayout. Yet the instructor optimizes the layout for scrolling within the layoutAttributesForElements by changing the method from a linear search to a binary. Binary searches are somewhat new to me, so after rewatching the video and doing some research, I found the collection needs to be sorted to be able to run a binary search. My problem is I get a bit confused on how to create the binary search and if your cachedCellLayoutAttributes are sorted already. In the video the instructor says the cachedCallLayoutAttributes are sorted by there frames minimum y value, yet when i debug cachedCellLayoutAttributes it seems that the there frames minimum y value isn't sorted. If you have any ideas or if its even worth doing in the first place let me know. I'll add video link and specific time of video below.
https://developer.apple.com/videos/play/wwdc2018/225/
Specific time about optimization within layoutAttributesForElements: 25:40 -> 28:00
I try to make a layout like snapchat gif that you attached with code but there is no any way to set layout pattern like this.
Can you please help me to do i am working with swift 2.2
It seems the right inset is not as large as what it should be.
I set the same value as the left and right insets. But the right displayed inset is smaller than the left.
I am adding images but I can not scroll till the bottom cell,
it says delegeate not found on my class.
i am using objective-c.
Layout works fine when it is initialised in viewDidLoad()
but after pull to refresh collectionview
lags and becomes very slow on scrolling.
The following delegate should be weak: open var delegate: TRMosaicLayoutDelegate!
Being a strong reference lead to a retain cycle on any controller using this delegate.
I will propose a PR soon to fix this if you don't mind.
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.