Skip to content

jcoff28/JCSegmentMenu

Repository files navigation

JCSegmentMenu

By Jordan Coff

Purpose

JCSegmentMenu is a light-weight front end for a tab control. Use it, love it, fork it, do stuff.

Usage

  1. Drag a UIView onto your storyboard
  2. Do autolayout stuff
  3. Set the class to JCSegmentMenu
  4. Set the delegate
  5. Create a referencing outlet
  6. Initialize the menu
[_segmentMenu setDelegate:self];
UIButton* b1 = [_segmentMenu defaultSegmentButtonWithOptions:@{@"type":@"image", @"imageName":image1}];
UIButton* b2 = [_segmentMenu defaultSegmentButtonWithOptions:@{@"type":@"image", @"imageName":image2}];
UIButton* b3 = [_segmentMenu defaultSegmentButtonWithOptions:@{@"type":@"image", @"imageName":image3}];
UIButton* b4 = [_segmentMenu defaultSegmentButtonWithOptions:@{@"type":@"image", @"imageName":image4}];
[_segmentMenu setSegmentButtons:@[b1, b2, b3, b4]];

The menu alerts the delegate when a segment is pressed.

@protocol JCSegmentMenuDelegate <NSObject>
@optional

-(void)button:(UIButton*)sender pressedAtIndex:(NSInteger) index;

@end

Customization

@property (nonatomic) CGFloat topSepHeight;
@property (nonatomic) CGFloat bottomSepHeight;
@property (nonatomic) CGFloat pointerHeight;
@property (nonatomic) UIColor* separatorColor;

Size, background color, etc are customizable using IB and autolayout.

Author

Jordan Coff

Please create a Github issue if you have any questions, suggestions, or comments.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published