Coder Social home page Coder Social logo

akpw / akpflowlayout Goto Github PK

View Code? Open in Web Editor NEW
21.0 3.0 8.0 132 KB

A custom UICollectionView layout with configurable global header and pinnable / stretchable sections (Swift 3 / Xcode 8.x)

License: MIT License

Ruby 2.72% Objective-C 1.73% Swift 94.37% Shell 1.17%

akpflowlayout's Introduction

AKPFlowLayout

Language License

AKPFlowLayout is a custom Collection View layout with configurable global header and pinnable, stretchable sections.

Blogs

Sample App

Features

  • A custom UICollectionViewFlowLayout-based layout with support for:
  • Global header
  • Sticky section headers
  • Pinnable, stretchable sections
  • Fully configurable

  • Built for performace using custom invalidation context

  • Written in Swift 3 and Xcode 8

Requirements

  • iOS 8+
  • Xcode 8
  • Swift 3

Installation

CocoaPods (recommended)

use_frameworks!
pod 'AKPFlowLayout'
  1. Add AKPFlowLayout to your Cartfile:
    github "akpw/AKPFlowLayout"
    
  2. Follow the Carthage instructions on adding frameworks for further reference

Docs

Initial docs, generated with jazzy and hosted by GitHub Pages.

Building the project

  1. Clone the repository
$ git clone https://github.com/akpw/AKPFlowLayout
  1. Run carthage.sh
$ cd AKPFlowLayout
$ ./carthage.sh
  1. Open the workspace in Xcode
$ open "AKPFlowLayout.xcworkspace"
  1. Compile and test in Xcode

akpflowlayout's People

Contributors

akpw avatar

Stargazers

 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

akpflowlayout's Issues

Incorrectly positioning section Headers for sections with no items (headers only)

In a collection view similar to the "SwiftNetworkImages" demo, the first section is used for the global section, and the second section, with a floating header, is where items are displayed.
When a fetch returns no data, the header of the 2nd section is displayed at offset 0,0, instead of under the top section. The issues is caused inside boundaryMetrics, which returns (0, 0) for empty sections.

Please see a fix to this issue in a separate fork.

Moving header on inserting section while scrolling

Hello @akpw,

to be honest I'm investigating this issue already when I used a "standard" UICollectionView with sectionHeadersPinToVisibleBounds. But because you seem a person with a deep know-how with collection view layouts, I ask you for some help.

I also see this issue when I use your implementation of sticky headers.

Issue:

If I insert a new section and scroll to this new section, then the first sticky header is moving with a strange animation. It is only happening when I set the content inset of the collection view to something unlike zero.
For me it doesn't make sense at all and i tried everything to work around, but nothing helps.

It would be great to get in contact because I think you could help me! :)

Kind regards
Jochen

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.