Uncategorized
By Acty, February 5, 2014
Want to improve the UX of your app, but you don’t know how?
Looking for a way to display efficiently many information on a screen?
Not that easy, and the UX is a very important/touchy subject.
We had the same problems, and that’s why we developed the swype menu!
Quick example: http://www.youtube.com/watch?v=1O1H_whrhCQ
Live example: https://itunes.apple.com/fr/app/application-du-jour/id438687037?mt=8
See how you can easily swype from one screen to another, and the way the title follows the screen, expanding and shrinking as you do the move.
Plus, it is, of course, fully customizable. Just put it in your app and unleash its power!
NB: The library is not compatible with ARC, but you can set -fno-objc-arc in your project settings under Targets -> Build Phases -> Compile Sources, this will make the library ARC compliant.
How to us the GBSwypeMenu :
1. Import the library in your project. In the file hierarchy, right click and select “Add files to <project name>..” and select the library directory.
2. In your header view controller import the library : #import “GBSwypeMenu/GBSwypeMenu.h”
And add these variables in your view controller :
@interface MyViewController : UIViewController <UIScrollViewDelegate,GBSwypeMenuDelegate>{
UIScrollView *container;
GBSwypeMenu *menu;
NSMutableArray *items;
}
Container is the scroll view that will be used to pass from one image to another, menu is the menu resizing, and items is the list of the things that will be displayed in the menu.
3. In your implementation file, create the variables :
// Create the variable displayed in the menu
items = [[NSMutableArray alloc] initWithObjects:"New York",
"Melbourne","Hong Kong",
“Osaka”,@”San Francisco”,nil];
460)];
container.pagingEnabled = YES;
container.delegate = self;
container.userInteractionEnabled = YES;
// Finally create the menu
menu = [[GBSwypeMenu alloc] initWithFrame:CGRectMake(0, 0, 320, 40)];
menu.delegate = self;
menu.clipsToBounds = YES;
4. Implement the GBSwypeMenuDelegate, for the menu to get the view to display
- (UILabel *) createLabelAtIndex: (int)index{
UILabel *labelTmp;
if(index < [items count]){
labelTmp = [UILabel new];
labelTmp.text = [items objectAtIndex:index];
labelTmp.backgroundColor = [UIColor clearColor];
labelTmp.textColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:1];
labelTmp.shadowColor = [UIColor grayColor];
labelTmp.shadowOffset = CGSizeMake(0, 1);
}
}else{
labelTmp = nil;
}
return labelTmp;
5. Implement the ScrollViewDelegate, that will tell the menu when the scroll view as move, to redisplay its content
– (void)scrollViewDidScroll:(UIScrollView *)scrollView {