smv

SMVerticalSegmentedControl

Showing:

Popularity

Downloads/wk

0

GitHub Stars

142

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

0

License

MIT

Categories

Readme

SMVerticalSegmentedControl

SMVerticalSegmentedControl is plain vertical segmented control (like UISegmentedControl). Component inspired by HMSegementedControl

Screenshots

UIAppearance support

PropertyTypeDefault value
backgroundColorUIColor[UIColor clearColor]
textFontUIFont[UIFont systemFontOfSize:14]
textColorUIColor#000000
selectedTextColorUIColor#34B5E5
selectionIndicatorColorUIColor#000000
selectionIndicatorThicknessCGFloat2
selectionBoxBackgroundColorAlphaCGFloat0.2
selectionBoxBorderColorAlphaCGFloat0.3
selectionBoxBorderWidthCGFloat1
segmentEdgeInsetUIEdgeInsets{ 5, 5, 5, 5 }
widthCGFloat100
PropertyTypeDefault value
selectionStyleSMVerticalSegmentedControlSelectionStyleSMVerticalSegmentedControlSelectionStyleTextHeightStrip
selectionLocationSMVerticalSegmentedControlSelectionLocationSMVerticalSegmentedControlTextAlignmentLeft
textAlignmentSMVerticalSegmentedControlTextAlignmentSMVerticalSegmentedControlTextAlignmentLeft

ARC


SMVerticalSegmentedControl uses ARC.

Installation


Add pod 'SMVerticalSegmentedControl', '~> 0.1.2' to your Podfile or add manually 2 files SMVerticalSegmentedControl.h, SMVerticalSegmentedControl.m to your project.

Examples


Simple
NSArray *titles = @[@"Title 1", @"Title 2", @"Title 3", @"Title 4"];
SMVerticalSegmentedControl *segmentedControl = [[SMVerticalSegmentedControl alloc] initWithSectionTitles:titles];
[self.view addSubview:segmentedControl];
Advanced
NSArray *titles = @[@"Title 1", @"Title 2", @"Title 3", @"Title 4"];
SMVerticalSegmentedControl *segmentedControl = [[SMVerticalSegmentedControl alloc] initWithSectionTitles:titles];
segmentedControl.selectedSegmentIndex = 3;
segmentedControl.textColor = [UIColor grayColor];
segmentedControl.selectedTextColor = [UIColor blackColor];
segmentedControl.textAlignment = SMVerticalSegmentedControlTextAlignmentCenter;
segmentedControl.selectionStyle = SMVerticalSegmentedControlSelectionStyleBox;
segmentedControl.selectionIndicatorThickness = 0;
segmentedControl.selectionBoxBorderWidth = 2;
segmentedControl.selectionBoxBackgroundColorAlpha = 0.5;
segmentedControl.selectionBoxBorderColorAlpha = 0.7;
segmentedControl.indexChangeBlock = ^(NSInteger index) {
    //TODO: add handler
};
[self.view addSubview:segmentedControl];
Appearance
//Customize the appearance of all vertical segmented control in you app
[SMVerticalSegmentedControl appearance].backgroundColor = [UIColor greyColor];
[SMVerticalSegmentedControl appearance].textColor = [UIColor whiteColor];
[SMVerticalSegmentedControl appearance].selectedTextColor = [UIColor blackColor];
[SMVerticalSegmentedControl appearance].selectionIndicatorColor = [UIColor redColor];
//Customize the appearance of vertical segmented control when they contained within a UIScrollView
[SMVerticalSegmentedControl appearanceWhenContainedIn:[UIScrollView class], nil].backgroundColor = [UIColor greyColor];
[SMVerticalSegmentedControl appearanceWhenContainedIn:[UIScrollView class], nil].textColor = [UIColor whiteColor];
[SMVerticalSegmentedControl appearanceWhenContainedIn:[UIScrollView class], nil].selectedTextColor = [UIColor blackColor];
[SMVerticalSegmentedControl appearanceWhenContainedIn:[UIScrollView class], nil].selectionIndicatorColor = [UIColor redColor];

Contact


License


SMVerticalSegmentedController is available under the MIT license.

Copyright © 2013 Michael Shkutkov

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100