Skip to content
This repository

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

Merged
merged 1 commit into from over 2 years ago

2 participants

Philippe Guitard Gulam Moledina
Philippe Guitard

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

Philippe Guitard 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
Gulam Moledina gmoledina merged commit c54c7cf into from
Gulam Moledina
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Dec 03, 2011
Philippe Guitard 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
This page is out of date. Refresh to see the latest.
4 GMGridView/API/GMGridView.h
@@ -146,8 +146,8 @@ typedef enum
146 146
147 147 @required
148 148 // Fullsize
149   -- (CGSize)GMGridView:(GMGridView *)gridView sizeInFullSizeForCell:(GMGridViewCell *)cell;
150   -- (UIView *)GMGridView:(GMGridView *)gridView fullSizeViewForCell:(GMGridViewCell *)cell;
  149 +- (CGSize)GMGridView:(GMGridView *)gridView sizeInFullSizeForCell:(GMGridViewCell *)cell atIndex:(NSInteger)index;
  150 +- (UIView *)GMGridView:(GMGridView *)gridView fullSizeViewForCell:(GMGridViewCell *)cell atIndex:(NSInteger)index;
151 151
152 152 // Transformation (pinch, drag, rotate) of the item
153 153 @optional
4 GMGridView/API/GMGridView.m
@@ -855,8 +855,8 @@ - (void)transformingGestureDidBeginWithGesture:(UIGestureRecognizer *)gesture
855 855 [self.mainSuperView addSubview:_transformingItem];
856 856 [self.mainSuperView bringSubviewToFront:_transformingItem];
857 857
858   - _transformingItem.fullSize = [self.transformDelegate GMGridView:self sizeInFullSizeForCell:_transformingItem];
859   - _transformingItem.fullSizeView = [self.transformDelegate GMGridView:self fullSizeViewForCell:_transformingItem];
  858 + _transformingItem.fullSize = [self.transformDelegate GMGridView:self sizeInFullSizeForCell:_transformingItem atIndex:positionTouch];
  859 + _transformingItem.fullSizeView = [self.transformDelegate GMGridView:self fullSizeViewForCell:_transformingItem atIndex:positionTouch];
860 860
861 861 if ([self.transformDelegate respondsToSelector:@selector(GMGridView:didStartTransformingCell:)])
862 862 {
8 GMGridView/Demo1ViewController.m
@@ -290,7 +290,7 @@ - (void)GMGridView:(GMGridView *)gridView exchangeItemAtIndex:(NSInteger)index1
290 290 #pragma mark DraggableGridViewTransformingDelegate
291 291 //////////////////////////////////////////////////////////////
292 292
293   -- (CGSize)GMGridView:(GMGridView *)gridView sizeInFullSizeForCell:(GMGridViewCell *)cell
  293 +- (CGSize)GMGridView:(GMGridView *)gridView sizeInFullSizeForCell:(GMGridViewCell *)cell atIndex:(NSInteger)index
294 294 {
295 295 if (INTERFACE_IS_PHONE)
296 296 {
@@ -302,18 +302,18 @@ - (CGSize)GMGridView:(GMGridView *)gridView sizeInFullSizeForCell:(GMGridViewCel
302 302 }
303 303 }
304 304
305   -- (UIView *)GMGridView:(GMGridView *)gridView fullSizeViewForCell:(GMGridViewCell *)cell
  305 +- (UIView *)GMGridView:(GMGridView *)gridView fullSizeViewForCell:(GMGridViewCell *)cell atIndex:(NSInteger)index
306 306 {
307 307 UIView *fullView = [[UIView alloc] init];
308 308 fullView.backgroundColor = [UIColor yellowColor];
309 309 fullView.layer.masksToBounds = NO;
310 310 fullView.layer.cornerRadius = 8;
311 311
312   - CGSize size = [self GMGridView:gridView sizeInFullSizeForCell:cell];
  312 + CGSize size = [self GMGridView:gridView sizeInFullSizeForCell:cell atIndex:index];
313 313 fullView.bounds = CGRectMake(0, 0, size.width, size.height);
314 314
315 315 UILabel *label = [[UILabel alloc] initWithFrame:fullView.bounds];
316   - label.text = @"Fullscreen View";
  316 + label.text = [NSString stringWithFormat:@"Fullscreen View for cell at index %d", index];
317 317 label.textAlignment = UITextAlignmentCenter;
318 318 label.backgroundColor = [UIColor clearColor];
319 319 label.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
8 GMGridView/Demo2ViewController.m
@@ -331,7 +331,7 @@ - (void)GMGridView:(GMGridView *)gridView exchangeItemAtIndex:(NSInteger)index1
331 331 #pragma mark DraggableGridViewTransformingDelegate
332 332 //////////////////////////////////////////////////////////////
333 333
334   -- (CGSize)GMGridView:(GMGridView *)gridView sizeInFullSizeForCell:(GMGridViewCell *)cell
  334 +- (CGSize)GMGridView:(GMGridView *)gridView sizeInFullSizeForCell:(GMGridViewCell *)cell atIndex:(NSInteger)index
335 335 {
336 336 if (INTERFACE_IS_PHONE)
337 337 {
@@ -343,18 +343,18 @@ - (CGSize)GMGridView:(GMGridView *)gridView sizeInFullSizeForCell:(GMGridViewCel
343 343 }
344 344 }
345 345
346   -- (UIView *)GMGridView:(GMGridView *)gridView fullSizeViewForCell:(GMGridViewCell *)cell
  346 +- (UIView *)GMGridView:(GMGridView *)gridView fullSizeViewForCell:(GMGridViewCell *)cell atIndex:(NSInteger)index
347 347 {
348 348 UIView *fullView = [[UIView alloc] init];
349 349 fullView.backgroundColor = [UIColor yellowColor];
350 350 fullView.layer.masksToBounds = NO;
351 351 fullView.layer.cornerRadius = 8;
352 352
353   - CGSize size = [self GMGridView:gridView sizeInFullSizeForCell:cell];
  353 + CGSize size = [self GMGridView:gridView sizeInFullSizeForCell:cell atIndex:index];
354 354 fullView.bounds = CGRectMake(0, 0, size.width, size.height);
355 355
356 356 UILabel *label = [[UILabel alloc] initWithFrame:fullView.bounds];
357   - label.text = @"Fullscreen View";
  357 + label.text = [NSString stringWithFormat:@"Fullscreen View for cell at index %d", index];
358 358 label.textAlignment = UITextAlignmentCenter;
359 359 label.backgroundColor = [UIColor clearColor];
360 360 label.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.