Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Addition of an index parameter to the full size methods #6

Merged
merged 1 commit into from

2 participants

@pguitard

The index of the cell being zoomed on allows easier access to the data associated to the cell.

@pguitard pguitard Added index to the full size methods
The index of the cell being zoomed on allows easier access to the data
associated to the cell.
5d92ef2
@gmoledina gmoledina merged commit c54c7cf into gmoledina:master
@gmoledina
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 3, 2011
  1. @pguitard

    Added index to the full size methods

    pguitard authored
    The index of the cell being zoomed on allows easier access to the data
    associated to the cell.
This page is out of date. Refresh to see the latest.
View
4 GMGridView/API/GMGridView.h
@@ -146,8 +146,8 @@ typedef enum
@required
// Fullsize
-- (CGSize)GMGridView:(GMGridView *)gridView sizeInFullSizeForCell:(GMGridViewCell *)cell;
-- (UIView *)GMGridView:(GMGridView *)gridView fullSizeViewForCell:(GMGridViewCell *)cell;
+- (CGSize)GMGridView:(GMGridView *)gridView sizeInFullSizeForCell:(GMGridViewCell *)cell atIndex:(NSInteger)index;
+- (UIView *)GMGridView:(GMGridView *)gridView fullSizeViewForCell:(GMGridViewCell *)cell atIndex:(NSInteger)index;
// Transformation (pinch, drag, rotate) of the item
@optional
View
4 GMGridView/API/GMGridView.m
@@ -855,8 +855,8 @@ - (void)transformingGestureDidBeginWithGesture:(UIGestureRecognizer *)gesture
[self.mainSuperView addSubview:_transformingItem];
[self.mainSuperView bringSubviewToFront:_transformingItem];
- _transformingItem.fullSize = [self.transformDelegate GMGridView:self sizeInFullSizeForCell:_transformingItem];
- _transformingItem.fullSizeView = [self.transformDelegate GMGridView:self fullSizeViewForCell:_transformingItem];
+ _transformingItem.fullSize = [self.transformDelegate GMGridView:self sizeInFullSizeForCell:_transformingItem atIndex:positionTouch];
+ _transformingItem.fullSizeView = [self.transformDelegate GMGridView:self fullSizeViewForCell:_transformingItem atIndex:positionTouch];
if ([self.transformDelegate respondsToSelector:@selector(GMGridView:didStartTransformingCell:)])
{
View
8 GMGridView/Demo1ViewController.m
@@ -290,7 +290,7 @@ - (void)GMGridView:(GMGridView *)gridView exchangeItemAtIndex:(NSInteger)index1
#pragma mark DraggableGridViewTransformingDelegate
//////////////////////////////////////////////////////////////
-- (CGSize)GMGridView:(GMGridView *)gridView sizeInFullSizeForCell:(GMGridViewCell *)cell
+- (CGSize)GMGridView:(GMGridView *)gridView sizeInFullSizeForCell:(GMGridViewCell *)cell atIndex:(NSInteger)index
{
if (INTERFACE_IS_PHONE)
{
@@ -302,18 +302,18 @@ - (CGSize)GMGridView:(GMGridView *)gridView sizeInFullSizeForCell:(GMGridViewCel
}
}
-- (UIView *)GMGridView:(GMGridView *)gridView fullSizeViewForCell:(GMGridViewCell *)cell
+- (UIView *)GMGridView:(GMGridView *)gridView fullSizeViewForCell:(GMGridViewCell *)cell atIndex:(NSInteger)index
{
UIView *fullView = [[UIView alloc] init];
fullView.backgroundColor = [UIColor yellowColor];
fullView.layer.masksToBounds = NO;
fullView.layer.cornerRadius = 8;
- CGSize size = [self GMGridView:gridView sizeInFullSizeForCell:cell];
+ CGSize size = [self GMGridView:gridView sizeInFullSizeForCell:cell atIndex:index];
fullView.bounds = CGRectMake(0, 0, size.width, size.height);
UILabel *label = [[UILabel alloc] initWithFrame:fullView.bounds];
- label.text = @"Fullscreen View";
+ label.text = [NSString stringWithFormat:@"Fullscreen View for cell at index %d", index];
label.textAlignment = UITextAlignmentCenter;
label.backgroundColor = [UIColor clearColor];
label.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
View
8 GMGridView/Demo2ViewController.m
@@ -331,7 +331,7 @@ - (void)GMGridView:(GMGridView *)gridView exchangeItemAtIndex:(NSInteger)index1
#pragma mark DraggableGridViewTransformingDelegate
//////////////////////////////////////////////////////////////
-- (CGSize)GMGridView:(GMGridView *)gridView sizeInFullSizeForCell:(GMGridViewCell *)cell
+- (CGSize)GMGridView:(GMGridView *)gridView sizeInFullSizeForCell:(GMGridViewCell *)cell atIndex:(NSInteger)index
{
if (INTERFACE_IS_PHONE)
{
@@ -343,18 +343,18 @@ - (CGSize)GMGridView:(GMGridView *)gridView sizeInFullSizeForCell:(GMGridViewCel
}
}
-- (UIView *)GMGridView:(GMGridView *)gridView fullSizeViewForCell:(GMGridViewCell *)cell
+- (UIView *)GMGridView:(GMGridView *)gridView fullSizeViewForCell:(GMGridViewCell *)cell atIndex:(NSInteger)index
{
UIView *fullView = [[UIView alloc] init];
fullView.backgroundColor = [UIColor yellowColor];
fullView.layer.masksToBounds = NO;
fullView.layer.cornerRadius = 8;
- CGSize size = [self GMGridView:gridView sizeInFullSizeForCell:cell];
+ CGSize size = [self GMGridView:gridView sizeInFullSizeForCell:cell atIndex:index];
fullView.bounds = CGRectMake(0, 0, size.width, size.height);
UILabel *label = [[UILabel alloc] initWithFrame:fullView.bounds];
- label.text = @"Fullscreen View";
+ label.text = [NSString stringWithFormat:@"Fullscreen View for cell at index %d", index];
label.textAlignment = UITextAlignmentCenter;
label.backgroundColor = [UIColor clearColor];
label.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
Something went wrong with that request. Please try again.