Latest 1.0
Homepage https://github.com/mushank/ZKSegmentedControl
License MIT
Platforms ios , requires ARC
Frameworks UIKit
Authors

A solution of segmented control with two items, callback with block.

1. Install

pod 'ZKSegmentedControl', '~> 1.0'

2. Usage

It’s so simple, just six lines of code:

#import "ZKSegmentedControl.h"

ZKSegmentedControl *segmentedControl = [[ZKSegmentedControl alloc]initWithFrame:CGRectMake(0.0, 0.0, 200.0, 30.0)];

// Set the left title, default is @"Left"
[segmentedControl setLeftTitle:@"LeftAction"];

// Set the right title, default is @"Right"
[segmentedControl setRightTitle:@"RightAction"];

// Set the selected item backgroung color, default is blackColor
[segmentedControl setSelectedBackgroundColor:[UIColor blackColor]]; 

// Left action call back with block
segmentedControl.leftActionBlock = ^{   
    NSLog(@"Left Segment Tapped");
};
// Right action call back with block
segmentedControl.rightActionBlock = ^{  
    NSLog(@"Right Segment Tapped");
};

3. Source files

They are in the ZKSegmentedControl folder:

  • ZKSegmentedControl.h
  • ZKSegmentedControl.m

Now, enjoy yourself!

Latest podspec

{
    "name": "ZKSegmentedControl",
    "version": "1.0",
    "license": "MIT",
    "summary": "A solution of segmented control with two items",
    "homepage": "https://github.com/mushank/ZKSegmentedControl",
    "authors": {
        "Jack": "[email protected]"
    },
    "source": {
        "git": "https://github.com/mushank/ZKSegmentedControl.git",
        "tag": "1.0"
    },
    "platforms": {
        "ios": null
    },
    "source_files": "ZKSegmentedControl/*.{h,m}",
    "frameworks": "UIKit",
    "requires_arc": true
}

Pin It on Pinterest

Share This