GithubHelp home page GithubHelp logo

magictabsobjc's Introduction

#Magic tabs

Available on Objective-C and RubyMotion

MagicTabs screenshot

#How to use

Add MagicView.h and MagicView.m files to your project, and #import it into your view controller. Every tab is just an instance of MagicView class. If you want 2 tabs, just create 2 instances of MagicView. Want 5? Create 5.

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

MagicTab's frame is important. If you want more than one magic tab, remember that every new tab should be created with:

  • higher WIDTH value (if we don't want them to be like on a screenshot, with a different width)
  • smaller X value (if we want to center it)
  • higher Y value (every new tab should be placed below previous tab, right?)

Now we need to assign z index to our tabs:

[magicTab setZIndex:1];

MagicTabs sizes

Now we can add each tab's title and content views. You can use any UIView for a content, but it would be great if its frame will be equal to magicTab's frame.

[magicView1 setViewTitle:@"Cool Title"];

//adding tableView as a content
CGRect magicFrame = CGRectMake(0, 0, [magicTab frame].size.width, [magicTab frame].size.height);

UITableView *tableView = [[UITableView alloc] initWithFrame:magicFrame];
[tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cellReuseID"];
[tableView setDelegate:self];
[tableView setDataSource:self];
[magicTab setContentView:tableView];

And don't forget to add magit tab to your view

[[self view] addSubview:magicTab];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.