giulio92 / gltablecollectionview Goto Github PK
View Code? Open in Web Editor NEWNetflix and App Store like UITableView with UICollectionView, written in pure Swift 4.2
License: MIT License
Netflix and App Store like UITableView with UICollectionView, written in pure Swift 4.2
License: MIT License
In License file, there's MIT license. On the page you have the AGPL badge. So?...
Hi,
For iOS projets it's will be great to make your component COCOAPODS compatible
Thanks
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!
Hi Giulio92, I would like customize action scroll UICollectionview. 1 scroll to show target next cell.
Excuse me for using google translate
Hi Giulio!
Great Project! Do you have any writing about Add/Delete Sections and Add/Delete CollectionView Cells from user interface, can you help me please. Thanks
Hi giulio92,
We need this project in Objective C please provide.
I am waiting for your reply.
Hi,
For iOS projets it's will be great to make your component Carthage compatible
Take a look at these articles:
On your README.md
add on top and add section for the installation with Carthage.
I want to use more than one UICollectionViewCell in the table view
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 ๐
Show default cell with custom new cell
Fatal error
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
}
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.
Hey @giulio92, does it work for tvOS? Would be awesome if it did.
Thanks,
P
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.