Giter VIP home page Giter VIP logo

glyuckdatagrid'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

glyuckdatagrid's Issues

Ability to scroll one dimension at a time?

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!

Change font size and color

How can I change the font size and the color of the text in a cell? I am using the example in the README.

Please, fix chashing while tapping on row header

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]

Bottom column header?

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!

Cells disappearing from UICollectionView

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.

Self-sizing cells

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 ๐Ÿ‘

Deprecated methods inside appearanceWhenContainedIn

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

Needs update to Swift 3.0

The grid needs to be updated for swift 3.0 or it won't be supported for much longer.

Awesome work by the way.

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.