NGVaryingGridView 0.0.1

NGVaryingGridView 0.0.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Unclaimed.



  • By
  • NOUSGuide Inc.

A GridView which allows to set individual Rects for the Cells. So you can define Cells with different Sizes, used e.g. in Timetables, EPGs, etc.

Sticky Views are also supported on top of the GridView and on the left side.

NGVaryingGridView

Usage

self.gridView = [[NGVaryingGridView alloc] initWithFrame:self.view.bounds];
self.gridView.gridViewDelegate = self;
[self.view addSubview:self.gridView];

[self.gridView reloadData];

The following Delegate-Methods are required:

// You should return an Array which contains CGRects for every Cell you want to display inside the GridView
- (NSArray *)rectsForCellsInGridView:(NGVaryingGridView *)gridView {
    NSMutableArray *rectsArray = [NSMutableArray array];
    [array addObject:[NSValue valueWithCGRect:CGrectMake(...)]]

    // ...

    return rectsArray;
}

// return an UIView representing your Cell
- (UIView *)gridView:(NGVaryingGridView *)gridView viewForCellWithRect:(CGRect)rect index:(NSUInteger)index {
    YourUIViewSubclass *gridCell = (YourUIViewSubclass *)[gridView dequeueReusableCell] ? : [[YourUIViewSubclass alloc] initWithFrame:rect];
    gridCell.frame = rect;

    // setup gridCell

    return gridCell
}

Just have a look inside the provided Demo-Application.

Credits

NGVaryingGridView was created by Philip Messlehner

License

NGPageControl is available under the MIT license. See the LICENSE file for more info. For usage without attribution contact NOUSguide.