qfgxcw
Last Updated: February 25, 2016
·
1.835K
· savitsky
Userpick

Draggable tabs

Simple implementation of the UI with draggable tabs:

Picture

Available on Objective-C and RubyMotion

Just add MagicView to your project and create some tabs:

MagicView *magicTab = [[MagicView alloc]
    initWithFrame:CGRectMake(X, Y, width, height)];

Assign z-index to every tab, and set its title:

[magicTab setZIndex:1];
[magicView1 setViewTitle:@"Cool Title"];

And add its content view. Table view for example:

CGRect magicFrame = CGRectMake(0, 0,
    [magicTab frame].size.width, 
    [magicTab frame].size.height);

UITableView *tableView = [[UITableView alloc]
    initWithFrame:magicFrame];
[magicTab setContentView:tableView];

And don't forget to add tabs to your view:

[[self view] addSubview:magicTab];

Github: Objective-C and RubyMotion

Say Thanks
Respond