Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c9a1151
Added UIApperance-Selectors
messi Apr 22, 2013
62942ce
added StrokColorSupport and tried to introduced UIApperance, but not …
messi Apr 24, 2013
2e49b49
fixed an UI_APPEARENCE_ISSUE
messi May 23, 2013
986176f
reduced ShadowOffset
messi May 25, 2013
3634385
Make selectedSegmentIndex a publicly readwrite property
Oct 31, 2013
0754413
Remove no longer used SVSegmentedControlDelegate
Oct 31, 2013
2deb51b
No need to keep Demo in podspec
Oct 31, 2013
e0ef436
fix xcode 5.1 warning
lloydsheng Mar 19, 2014
090c7e5
fix xcode 5.1 warning
lloydsheng Mar 19, 2014
811a064
should not use setter in initializer due to UIAppearance issues
messi Apr 10, 2014
3fd5f69
fixed Warnings
messi Apr 10, 2014
5509c8b
Added style presets for iOS 7, updated the demo project, and document…
danblakemore Jun 5, 2014
ce12ac4
missed one gradient
danblakemore Jun 6, 2014
3ffd453
Fix 64-bit warnings (int)
Jun 24, 2014
b284971
Merge branch 'refs/heads/readwrite_selectedSegmentIndex'
Nov 11, 2014
cfc574f
Merge remote-tracking branch 'fork/remove_delegate'
Nov 11, 2014
75c363c
Merge branch 'refs/heads/update_podspec'
Nov 11, 2014
91cdb55
Merge pull request #1 from lloydsheng/master
Nov 11, 2014
96d8265
Merge branch 'master' of github.com:danblakemore/SVSegmentedControl i…
Nov 11, 2014
826eb45
Merge branch 'refs/heads/danblakemore-master'
Nov 11, 2014
8693373
Fix warnings
Nov 11, 2014
ad812f0
Merge branch 'master' of github.com:joshua-nord/SVSegmentedControl in…
Nov 11, 2014
466bca2
Merge branch 'refs/heads/joshua-nord-master'
Nov 11, 2014
72331af
Merge branch 'master' of github.com:PocketScientists/SVSegmentedContr…
Nov 11, 2014
f9088ad
Merge branch 'refs/heads/PocketScientists-master'
Nov 11, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Demo/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Demo/1@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Demo/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Demo/2@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Demo/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Demo/3@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 39 additions & 5 deletions Demo/Classes/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ - (void)viewDidLoad {

SVSegmentedControl *navSC = [[SVSegmentedControl alloc] initWithSectionTitles:[NSArray arrayWithObjects:@"Section 1", @"Section 2", nil]];
navSC.changeHandler = ^(NSUInteger newIndex) {
NSLog(@"segmentedControl did select index %i (via block handler)", newIndex);
NSLog(@"segmentedControl did select index %@ (via block handler)", @(newIndex));
};

[self.view addSubview:navSC];
Expand All @@ -36,7 +36,7 @@ - (void)viewDidLoad {

[self.view addSubview:redSC];

redSC.center = CGPointMake(160, 170);
redSC.center = CGPointMake(160, 150);


// 3rd CONTROL
Expand All @@ -50,7 +50,7 @@ - (void)viewDidLoad {

[self.view addSubview:grayRC];

grayRC.center = CGPointMake(160, 270);
grayRC.center = CGPointMake(160, 230);


// 4th CONTROL
Expand All @@ -68,14 +68,48 @@ - (void)viewDidLoad {

[self.view addSubview:yellowRC];

yellowRC.center = CGPointMake(160, 370);
yellowRC.center = CGPointMake(160, 310);


// 4th CONTROL
SVSegmentedControl *imageRC = [[SVSegmentedControl alloc] initWithSectionTitles:[NSArray arrayWithObjects:@"Some", @"Section", @"Images", nil]];
[imageRC setSectionImages:@[[UIImage imageNamed:@"1"], [UIImage imageNamed:@"2"], [UIImage imageNamed:@"3"], [UIImage imageNamed:@"3"]]];
[imageRC addTarget:self action:@selector(segmentedControlChangedValue:) forControlEvents:UIControlEventValueChanged];
imageRC.crossFadeLabelsOnDrag = YES;
imageRC.titleEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 5);
imageRC.height = 40;
[imageRC setSelectedSegmentIndex:0 animated:NO];
imageRC.thumb.tintColor = [UIColor colorWithRed:0.100 green:0.400 blue:0.800 alpha:1.000];
imageRC.thumb.textColor = [UIColor whiteColor];
imageRC.thumb.textColor = [UIColor whiteColor];
imageRC.thumb.textShadowColor = [UIColor colorWithWhite:0 alpha:0.5];
imageRC.thumb.textShadowOffset = CGSizeMake(0, 1);

[self.view addSubview:imageRC];

imageRC.center = CGPointMake(160, 390);


// 5th CONTROL
SVSegmentedControl *iOS7FlatRC = [[SVSegmentedControl alloc] initWithSectionTitles:[NSArray arrayWithObjects:@"Can", @"Look", @"Flat", nil] stylePreset:SVSegmentedControlStylePresetFlat];
[iOS7FlatRC addTarget:self action:@selector(segmentedControlChangedValue:) forControlEvents:UIControlEventValueChanged];
iOS7FlatRC.titleEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 5);
iOS7FlatRC.height = 40;
[iOS7FlatRC setSelectedSegmentIndex:1 animated:NO];
iOS7FlatRC.thumb.tintColor = [UIColor colorWithRed:1.000 green:0.300 blue:0.100 alpha:1.000];
iOS7FlatRC.thumb.textColor = [UIColor whiteColor];
iOS7FlatRC.thumb.textColor = [UIColor whiteColor];

[self.view addSubview:iOS7FlatRC];

iOS7FlatRC.center = CGPointMake(160, 470);
}


#pragma mark - UIControlEventValueChanged

- (void)segmentedControlChangedValue:(SVSegmentedControl*)segmentedControl {
NSLog(@"segmentedControl %i did select index %i (via UIControl method)", segmentedControl.tag, segmentedControl.selectedSegmentIndex);
NSLog(@"segmentedControl %@ did select index %@ (via UIControl method)", @(segmentedControl.tag), @(segmentedControl.selectedSegmentIndex));
}


Expand Down
32 changes: 28 additions & 4 deletions Demo/SVSegmentedControl.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
2899E5220DE3E06400AC0155 /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* ViewController.xib */; };
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; };
28D7ACF80DDB3853001CB0EB /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* ViewController.m */; };
651F8D091940E22A00345FC0 /* 1.png in Resources */ = {isa = PBXBuildFile; fileRef = 651F8D031940E22A00345FC0 /* 1.png */; };
651F8D0A1940E22A00345FC0 /* 1@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 651F8D041940E22A00345FC0 /* 1@2x.png */; };
651F8D0B1940E22A00345FC0 /* 2.png in Resources */ = {isa = PBXBuildFile; fileRef = 651F8D051940E22A00345FC0 /* 2.png */; };
651F8D0C1940E22A00345FC0 /* 2@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 651F8D061940E22A00345FC0 /* 2@2x.png */; };
651F8D0D1940E22A00345FC0 /* 3.png in Resources */ = {isa = PBXBuildFile; fileRef = 651F8D071940E22A00345FC0 /* 3.png */; };
651F8D0E1940E22A00345FC0 /* 3@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 651F8D081940E22A00345FC0 /* 3@2x.png */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -44,6 +50,12 @@
28D7ACF70DDB3853001CB0EB /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
32CA4F630368D1EE00C91783 /* SVSegmentedControl_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVSegmentedControl_Prefix.pch; sourceTree = "<group>"; };
651F8D031940E22A00345FC0 /* 1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 1.png; sourceTree = "<group>"; };
651F8D041940E22A00345FC0 /* 1@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "1@2x.png"; sourceTree = "<group>"; };
651F8D051940E22A00345FC0 /* 2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 2.png; sourceTree = "<group>"; };
651F8D061940E22A00345FC0 /* 2@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "2@2x.png"; sourceTree = "<group>"; };
651F8D071940E22A00345FC0 /* 3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 3.png; sourceTree = "<group>"; };
651F8D081940E22A00345FC0 /* 3@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "3@2x.png"; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* SVSegmentedControl-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "SVSegmentedControl-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -124,6 +136,12 @@
children = (
28AD733E0D9D9553002E5188 /* MainWindow.xib */,
8D1107310486CEB800E47090 /* SVSegmentedControl-Info.plist */,
651F8D031940E22A00345FC0 /* 1.png */,
651F8D041940E22A00345FC0 /* 1@2x.png */,
651F8D051940E22A00345FC0 /* 2.png */,
651F8D061940E22A00345FC0 /* 2@2x.png */,
651F8D071940E22A00345FC0 /* 3.png */,
651F8D081940E22A00345FC0 /* 3@2x.png */,
);
name = Resources;
sourceTree = "<group>";
Expand Down Expand Up @@ -165,7 +183,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0450;
LastUpgradeCheck = 0510;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SVSegmentedControl" */;
compatibilityVersion = "Xcode 3.2";
Expand All @@ -191,9 +209,15 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
651F8D0A1940E22A00345FC0 /* 1@2x.png in Resources */,
651F8D0E1940E22A00345FC0 /* 3@2x.png in Resources */,
651F8D0B1940E22A00345FC0 /* 2.png in Resources */,
651F8D0D1940E22A00345FC0 /* 3.png in Resources */,
651F8D091940E22A00345FC0 /* 1.png in Resources */,
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */,
2899E5220DE3E06400AC0155 /* ViewController.xib in Resources */,
224B1756145F25D600BD2DDB /* README.md in Resources */,
651F8D0C1940E22A00345FC0 /* 2@2x.png in Resources */,
22A748901630AD4E004893A8 /* Default-568h@2x.png in Resources */,
223F841D16BC891900C3C219 /* SVSegmentedControl.podspec in Resources */,
);
Expand Down Expand Up @@ -229,7 +253,6 @@
GCC_PREFIX_HEADER = SVSegmentedControl_Prefix.pch;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "SVSegmentedControl-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
PRODUCT_NAME = SVSC;
RUN_CLANG_STATIC_ANALYZER = YES;
};
Expand All @@ -254,23 +277,24 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
};
Expand Down
1 change: 0 additions & 1 deletion SVSegmentedControl.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ Pod::Spec.new do |s|
s.description = 'SVSegmentedControl is a customizable UIControl class that mimics UISegmentedControl but that looks like an UISwitch.'
s.frameworks = 'QuartzCore'
s.source_files = 'SVSegmentedControl/*.{h,m}'
s.preserve_paths = 'Demo'
s.requires_arc = true
end
187 changes: 165 additions & 22 deletions SVSegmentedControl/SVSegmentedControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,187 @@
#import "SVSegmentedThumb.h"
#import <AvailabilityMacros.h>

@protocol SVSegmentedControlDelegate;
/**
* Default initial styles to enable or disable multiple visual attributes at once.
*/
typedef NS_ENUM(NSInteger, SVSegmentedControlStylePreset)
{
/**
* The default style used when nothing is set. Shadows and gradient are intact.
*/
SVSegmentedControlStylePresetDefault,
/**
* A flat style to match iOS 7+ style layouts. All shadows and gradient disabled.
*/
SVSegmentedControlStylePresetFlat,
};

@interface SVSegmentedControl : UIControl

/**
* A block called whenever there is a change to the switch.
* If you haven't fallen in love with blocks yet, you can still use the classic UIControl method:
* @code
[mySegmentedControl addTarget:self action:@selector(segmentedControlChangedValue:) forControlEvents:UIControlEventValueChanged];
* @endcode
*
* Providing an action method ending with a semicolon, the sender object is therefore made accessible:
* @code
- (void)segmentedControlChangedValue:(SVSegmentedControl*)segmentedControl {
NSLog(@"segmentedControl did select index %i", segmentedControl.selectedIndex);
}
* @endcode
*/
@property (nonatomic, copy) void (^changeHandler)(NSUInteger newIndex); // you can also use addTarget:action:forControlEvents:

/**
* The titles for each section of the switch. These are laid out in the order specicied in the array.
*/
@property (nonatomic, copy) NSArray *sectionTitles;

/**
* Images placed to the left of section titles. Images are assigned to titles with corresponding indices.
* If not enough images are provided, the remaining section(s) will be displayed normally.
* If too many images are provided, the remaining images are not displayed.
*/
@property (nonatomic, copy) NSArray *sectionImages;

/**
* The thumb that moves to the selected section. Access this property to change its appearance.
*/
@property (nonatomic, strong, readonly) SVSegmentedThumb *thumb;
@property (nonatomic, readonly) NSUInteger selectedSegmentIndex; // default is 0

/**
* The currently selected index of the switch. The default value is 0.
*/
@property (nonatomic, readwrite) NSUInteger selectedSegmentIndex; // default is 0

/**
* Whether or not to animated the change to initial selection. The default value is NO.
* @remarks This doesn't seem to be used anywhere.
*/
@property (nonatomic, readwrite) BOOL animateToInitialSelection; // default is NO

/**
* Whether or not to change the title on the thumb, or slide the thumb over the titles.
* If set to NO (the default) the thumb moves while the old and new titles stay lined up with the titles
* in the background, sliding on and off the thumb.
* If set to YES, as the thumb moves, the title stays in place and fades between the two sections.
*/
@property (nonatomic, readwrite) BOOL crossFadeLabelsOnDrag; // default is NO

/**
* Whether the switch must be changed with a pan gesture to make the control difficult to accidentally change.
* The default is NO.
*/
@property (nonatomic, readwrite) BOOL mustSlideToChange; // default is NO - To make the control difficult to accidentally change, force the user to slide it
@property (nonatomic, readwrite) CGFloat minimumOverlapToChange; // default is 0.66 - Only snap to a new segment if the thumb overlaps it by this fraction
@property (nonatomic, readwrite) UIEdgeInsets touchTargetMargins; // default is UIEdgeInsetsMake(0, 0, 0, 0) - Enlarge touch target of control

@property (nonatomic, strong) UIColor *backgroundTintColor; // default is [UIColor colorWithWhite:0.1 alpha:1]
@property (nonatomic, strong) UIImage *backgroundImage; // default is nil

@property (nonatomic, readwrite) CGFloat height; // default is 32.0
@property (nonatomic, readwrite) UIEdgeInsets thumbEdgeInset; // default is UIEdgeInsetsMake(2, 2, 3, 2)
@property (nonatomic, readwrite) UIEdgeInsets titleEdgeInsets; // default is UIEdgeInsetsMake(0, 10, 0, 10)
@property (nonatomic, readwrite) CGFloat cornerRadius; // default is 4.0
/**
* The fractional amount by which the thumb must overlap a destination segment to cause a snap to that segment.
* The default value is 0.66.
*/
@property (nonatomic, readwrite) CGFloat minimumOverlapToChange; // default is 0.66 - Only snap to a new segment if the thumb overlaps it by this fraction

@property (nonatomic, strong) UIFont *font; // default is [UIFont boldSystemFontOfSize:15]
@property (nonatomic, strong) UIColor *textColor; // default is [UIColor grayColor];
@property (nonatomic, strong) UIColor *textShadowColor; // default is [UIColor blackColor]
@property (nonatomic, readwrite) CGSize textShadowOffset; // default is CGSizeMake(0, -1)
@property (nonatomic, strong) UIColor *innerShadowColor; // default is [UIColor colorWithWhite:0 alpha:0.8]
/**
* Margins to add to the touchable area of the control.
* The default is UIEdgeInsetsMake(0, 0, 0, 0).
*/
@property (nonatomic, readwrite) UIEdgeInsets touchTargetMargins; // default is UIEdgeInsetsMake(0, 0, 0, 0) - Enlarge touch target of control

/**
* The color used in the background of the switch.
* The default is [UIColor colorWithWhite:0.1 alpha:1].
*/
@property (nonatomic, strong) UIColor *backgroundTintColor UI_APPEARANCE_SELECTOR; // default is [UIColor colorWithWhite:0.1 alpha:1]

/**
* The image used in the background of the switch.
* The default is nil.
*/
@property (nonatomic, strong) UIImage *backgroundImage UI_APPEARANCE_SELECTOR; // default is nil

@property (nonatomic, strong) UIColor *strokeColor UI_APPEARANCE_SELECTOR; // default is nil;

/**
* The height of the control. The default is 32.0.
*/
@property (nonatomic, readwrite) CGFloat height UI_APPEARANCE_SELECTOR; // default is 32.0

/**
* The insets of the thumb from the boundries of the segment and the control.
* The default is UIEdgeInsetsMake(2, 2, 3, 2).
*/
@property (nonatomic, readwrite) UIEdgeInsets thumbEdgeInset UI_APPEARANCE_SELECTOR; // default is UIEdgeInsetsMake(2, 2, 3, 2)

/**
* The insets from the edge of the control to the edges of the segment titles.
* The default is UIEdgeInsetsMake(0, 10, 0, 10).
*/
@property (nonatomic, readwrite) UIEdgeInsets titleEdgeInsets UI_APPEARANCE_SELECTOR; // default is UIEdgeInsetsMake(0, 10, 0, 10)

/**
* The corner radius of the control. The default is 4.0.
*/
@property (nonatomic, readwrite) CGFloat cornerRadius UI_APPEARANCE_SELECTOR; // default is 4.0

/**
* The font used for the titles. The default is [UIFont boldSystemFontOfSize:15].
*/
@property (nonatomic, strong) UIFont *font UI_APPEARANCE_SELECTOR; // default is [UIFont boldSystemFontOfSize:15]

/**
* The color of the text in the segments that are not selected. The default is [UIColor grayColor].
*/
@property (nonatomic, strong) UIColor *textColor UI_APPEARANCE_SELECTOR; // default is [UIColor grayColor];

/**
* The color of the shadow for the text in the segments that are not selected. The default is [UIColor blackColor].
*/
@property (nonatomic, strong) UIColor *textShadowColor UI_APPEARANCE_SELECTOR; // default is [UIColor blackColor]

/**
* The offset of the shadow from the text in the segments that are not selected. The default is CGSizeMake(0, -1).
*/
@property (nonatomic, readwrite) CGSize textShadowOffset UI_APPEARANCE_SELECTOR; // default is CGSizeMake(0, -1)

/**
* The color of the shadow inside the control along the edges. The default is [UIColor colorWithWhite:0 alpha:0.8].
*/
@property (nonatomic, strong) UIColor *innerShadowColor UI_APPEARANCE_SELECTOR; // default is [UIColor colorWithWhite:0 alpha:0.8]

/**
* The preset style. Setting this will change all documented shadow colors, the thumb gradient,
* and remove the bottom gloss. The default value is SVSegmentedControlStylePresetDefault.
*/
@property (nonatomic, readwrite) SVSegmentedControlStylePreset stylePreset;

/**
* Make a new segmented control with the specified section titles.
* Initialized with SVSegmentedControlStylePresetDefault.
*
* @param titlesArray an array of section titles for the new control
*
* @return a new segemented control with the specified titles
*/
- (SVSegmentedControl*)initWithSectionTitles:(NSArray*)titlesArray;

/**
* Make a new segmented control with the specified section titles and style.
*
*
* @param titlesArray an array of section titles for the new control
* @param style the initial styling preset for the control
*
* @return a new segmented control with the specified titles and style preset
*/
- (SVSegmentedControl*)initWithSectionTitles:(NSArray*)titlesArray stylePreset:(SVSegmentedControlStylePreset)stylePreset;

/**
* Selects a specified index in the control. Either animates or jumps straight to the new state.
*
* @param index the new index to select
* @param animated whether to animate the change in selection
*/
- (void)setSelectedSegmentIndex:(NSUInteger)index animated:(BOOL)animated;

// deprecated
Expand All @@ -54,9 +203,3 @@

@end


@protocol SVSegmentedControlDelegate

- (void)segmentedControl:(SVSegmentedControl*)segmentedControl didSelectIndex:(NSUInteger)index;

@end
Loading