Giter VIP home page Giter VIP logo

gltablecollectionview's People

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gltablecollectionview's Issues

AGPL or MIT?

In License file, there's MIT license. On the page you have the AGPL badge. So?...

Cocoapods Support

Hi,
For iOS projets it's will be great to make your component COCOAPODS compatible

Thanks

How to get "indexPath.section" in a UICollectionView?

Thank you for the great project!!
When I tapped a collectionView, how can I get "indexPath.section"?
I could get indexPath.item but indexPath.section always returns "0".

func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { print(indexPath.section) print(indexPath.item) }

Thank you!

Customize Scroll UICollectionview

Hi Giulio92, I would like customize action scroll UICollectionview. 1 scroll to show target next cell.
Excuse me for using google translate

How to install this?

Description:

Expected Behavior:

Actual Behavior:

Steps to Reproduce:

Your Environment:

  • GLTableCollectionView version:
  • Device:
  • iOS version:

Use custom UICollectionViewCell

I want to use more than one UICollectionViewCell in the table view

Description:

I want to use more than one UICollectionViewCell in the table view but get fatal error like the custom cell didn't registered!
It works just with one view cell (default cell or custom cell) but if i want to use mixed of these i got error.
Thanks for your help ๐Ÿ‘

Expected Behavior:

Show default cell with custom new cell

Actual Behavior:

Fatal error

Steps to Reproduce:

Custom cell -> GameCell.swift

import UIKit

class GameCell: UICollectionViewCell {
    
    static let id: String = "collectionViewCellID"
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupViews()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    let imageView: UIImageView = {
        let iv = UIImageView()
        iv.contentMode = .scaleAspectFill
        iv.layer.cornerRadius = 16
        iv.layer.masksToBounds = true
        iv.image = UIImage(named: "someImage")
        return iv
    }()
    
    func setupViews() {
        addSubview(imageView)
        
        imageView.frame = CGRect(x: 0, y: 0, width: frame.width, height: frame.width)
    }
}

GLCollectionTableViewCell.swift -> line 147

collectionView.register(GameCell.self, forCellWithReuseIdentifier: GameCell.id)

GLTableCollectionViewController.swift -> line 117

        if indexPath.item % 2 == 0 {
            guard let cell: GLIndexedCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: GLIndexedCollectionViewCell.identifier, for: indexPath) as? GLIndexedCollectionViewCell else {
                fatalError("UICollectionViewCell must be of GLIndexedCollectionViewCell type")
            }
            cell.backgroundColor = UIColor(hue: CGFloat(indexPath.item) / 20.0, saturation: 0.8, brightness: 0.9, alpha: 1)
            return cell
        }
        else{
            guard let cell: GameCell = collectionView.dequeueReusableCell(withReuseIdentifier: GameCell.id, for: indexPath) as? GameCell else {
                fatalError("UICollectionViewCell must be of GLIndexedCollectionViewCell type")
            }
            return cell
        }

Your Environment:

  • xCode: 9.4.1
  • GLTableCollectionView version: Last Version
  • Device: iPhone 6s (Real Device)
  • iOS version: 11.4

Jumping to end of Content

I had an issue with GLIndexedCollectionViewFlowLayout where when content offset is 0, if I were to bounce the collection (pull it to have a negative content offset on x) the offset would jump to the very end of the loaded content in the collection.

I added this:

if offsetCorrection != .greatestFiniteMagnitude {
    return CGPoint(x: proposedContentOffset.x + offsetCorrection, y: 0)
} else {
    return CGPoint(x: proposedContentOffset.x , y: 0)
}

to the final return in:

func targetContentOffset(forProposedContentOffset proposedContentOffset: , withScrollingVelocity velocity: )

Probably not the best way to handle this behavior, since I am not 100% sure why that number needs to be so high

I just wanted to bring some attention to this, as I wasn't sure if it was intended behavior to scroll to the end on a bounce at the beginning of the collection like that.

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.