Code Monkey home page Code Monkey logo

mosaic-layout's People

Contributors

basthomas avatar drusy avatar ibrahimyildirim avatar lfarah avatar vinnyoodles 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

mosaic-layout's Issues

custom layout not attached

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 indexPathwas 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.

What I am missing, what should I do?

Many thanks in advance

Bug when having all small items

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:
scrolled_down

But there are 3 items incorrectly still below the fold. I can see them when I pull the CollectionView up:
under the fold

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?

Doesn't scroll when big one cell alone

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?

Swift 3 compatibility

Hey, I'd love to see this lib available in Swift 3 so I can implement it in my project.

Thanks ๐Ÿ˜„

Headers not working?

Anyone else have trouble adding collectionview headers with the Mosaic Layout?

Would a binary search be quicker then a linear search in layoutAttributesForElements?

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

How to set a SnapChat Layout in current Demo

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

UIEdgeInsets is not working properly

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.

Lag on pull to refresh.

Layout works fine when it is initialised in viewDidLoad() but after pull to refresh collectionview lags and becomes very slow on scrolling.

Retain cycle on TRMosaicLayoutDelegate

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.

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.