glyuck / glyuckdatagrid Goto Github PK
View Code? Open in Web Editor NEWDataGridView (multicolumn tables) for iOS based on UICollectionView
License: MIT License
DataGridView (multicolumn tables) for iOS based on UICollectionView
License: MIT License
Hello,
I'm experimenting a bit with this framework and was wondering if there is an easy way to force scrolling across just one axis (x or y) instead of the free panning behavior that is default? I know UICollectionView by default behaves this way, but I can't seem to figure out a way to allow this in DataGrid. I want the user to be able to scroll both directions, but only one at a time.
Any help would be greatly appreciated!
the function only return row index, but how can i find indexpath (exact row and column)
Please update libary for cocoapod swift 3.0
How to selection multiple rows ? I tested on "Multiplication table" sample.
Sample I want to select row 1, 2 on the same time now it's only support single row.
And also http://cocoadocs.org/docsets/GlyuckDataGrid/0.3.0/index.html
Can you update on document file will be good ?
Thanks you
How can I change the font size and the color of the text in a cell? I am using the example in the README.
Inside this class
public class DataGridViewBaseHeaderCell: DataGridViewBaseCell {
change function
public func didTap(gesture: UITapGestureRecognizer) { dataGridView.collectionViewDelegate.collectionView(dataGridView.collectionView, didTapHeaderForColumn: indexPath.row) }
into
public func didTap(gesture: UITapGestureRecognizer) {
dataGridView.collectionViewDelegate.collectionView(dataGridView.collectionView, didTapHeaderForColumn: indexPath.index)
}
if use the fisrt variant the library crashes with
Assertion failure in -[NSIndexPath row]
Hi, would it be possible to add a column header on the bottom of the grid?
I can't use normal cells because I need it to be always visible.
Thank you!
Hi,
I know this library does not support self-sizing cells.
To make it work with the dynamic width I am setting cell width based on the highest (longest) textLabel width based on sizeWithFont... method.
//Assuming max width = 200
func dataGridView(_ dataGridView: DataGridView, widthForColumn column: Int) -> CGFloat {
return dataSource.columnWidths[dataSource.header[column].key] ?? 0
}
func dataGridView(_ dataGridView: DataGridView, heightForRow row: Int) -> CGFloat {
return dataSource.rows[row].max(by: {$1.height > $0.height})?.height ?? 0
}
For calculating height I am using max textLabel height for that particular row and applying it to each component of that row.
This works perfectly fine in most of the cases but sometimes the cells start disappearing randomly. It shows up again when I scroll up/down a bit.
I tried various solutions posted on community(http://ioscake.com/uicollectionviews-cell-disappearing.html) and came to a conclusion that this can only happen if layoutAttributesForElements(in rect: CGRect) returns wrong attributes.
In most cases it seems to happen only when the rows are more than 100..
@glyuck It there cance that layoutAttributesForElements returns false attributes? I would really appreciate if you could help me with this.
im making progress on my own implemtation, however i am unable to access indexPath.dataGridColumn
in objective c
Hi.
Is there a way to detect which row or cell was doubled tapped?
Thanks
Steve
Hi,
is there a possibility to create self-sizing cells? I know that without setting widthForColumn
cells are fitted to screen. I want to set cell width based on the highest (longest) textLabel
width.
My only idea is to go through all the data and get the highest width value based on sizeWithFont...
method.
Thanks a lot for this library btw ๐
I can't send any pull request. Update in order to support new API.
My updated file:
#import "UIView+Appearance_Swift.h"
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
@implementation UIView (Appearance_Swift)
+ (instancetype)glyuck_appearanceWhenContainedIn:(Class<UIAppearanceContainer>)containerClass {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0")) {
return [self appearanceWhenContainedInInstancesOfClasses:@[containerClass]];
} else {
return [self appearanceWhenContainedIn:containerClass, nil];
}
}
+ (instancetype)glyuck_appearanceWhenContainedIn:(Class<UIAppearanceContainer>)containerClass class2:(Class<UIAppearanceContainer>)containerClass2 {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0")) {
return [self appearanceWhenContainedInInstancesOfClasses:@[containerClass, containerClass2]];
} else {
return [self appearanceWhenContainedIn:containerClass, containerClass2, nil];
}
}
@end
The grid needs to be updated for swift 3.0 or it won't be supported for much longer.
Awesome work by the way.
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.