GithubHelp home page GithubHelp logo

cruzdiego / horizontalfloatingheaderlayout Goto Github PK

View Code? Open in Web Editor NEW
157.0 157.0 20.0 3.47 MB

Floating headers with horizontal scrolling layout for UICollectionView, inspired by iOS native Emoji Keyboard layout

License: MIT License

Swift 89.72% Ruby 10.28%

horizontalfloatingheaderlayout's People

Contributors

cruzdiego 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

horizontalfloatingheaderlayout's Issues

subclass UICollectionViewFlowLayout

Hi Diego,
Really great job with this layout. Just wondering, have you considered subclassing UICollectionViewFlowLayout instead of UICollecitonViewLayout, and not introducing a new delegate (use flowLayout instead)?

Stas

Crash in function lastItemMaxX() because of hardcoded -1

Thanks for sharing your collectionView layout. I came across this crash when trying it out.

Occurs when the dateSource returns 0 sections.

func lastItemMaxX()->CGFloat{
            let lastSection = collectionView.numberOfSections - 1
            let lastIndexInSection = collectionView.numberOfItems(inSection:lastSection) - 1
            if let lastItemAttributes = layoutAttributesForItem(at: IndexPath(row: lastIndexInSection, section: lastSection)){
                return lastItemAttributes.frame.maxX
            }else{
                return 0
            }
        }

Incorrect alignment when items width is less than header width

Thanks for sharing this layout. Just a heads-up that the layout might behave unexpectedly when the width of the items is less than the header's width.

image

As you can see in this screenshot, the header of the first and last section is aligned incorrectly. It seems like that the total width of the sections items is not taking into account.

Hey! :)

I loved your subclass, friend. I'm implementing it on my school project.
I have question: How can I change the position of section? I don't see any delegate method that could help me here.

delegate methods are not being called

Hi. I am having issues with getting the example project to work. When I run it, the app builds successfully but loads to a blank screen with the navigation header displayed. In my attempt to debug this, I discovered that none of the HorizontalFloatingHeaderLayoutDelegate methods are called. cellForItemAt is not being called either. Any help or guidance on this would be much appreciated. Thanks!

Swift 3 Support

Hi, are you considering adding the swift 3 support soon?
If not, I can push you a pull request if you open a swift3 branch.

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.