iOS Open Source: Data Aware View Controller To Display UIViews In Grid Layout
December 13, 2012
BDDynamicGridViewController is an open source project written by Norsez Orankijanan which lays out UIView objects in a grid format.
Each action of reloading data results in a new layout. As far as user interaction there are currently two gestures available: long press and double tap.
The video below shows the demo application included in the project:
The alert dialogs shown in the video I added in the viewDidLoad method. The same information is also shown in the debug console:
self.onLongPress = ^(UIView* view, NSInteger viewIndex) { NSString *msg = [NSString stringWithFormat:@"%@ index:%d", view, viewIndex]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Long Press" message:msg delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [alert show]; NSLog(@"Long press:%@ index:%d", view, viewIndex); }; self.onDoubleTap = ^(UIView* view, NSInteger viewIndex) { NSString *msg = [NSString stringWithFormat:@"%@ index:%d", view, viewIndex]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Double Tap" message:msg delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [alert show]; NSLog(@"Double tap:%@ index:%d", view, viewIndex); }; |



