• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ShadyElyaski/ios-filter-control: An iOS Filter UIControl Subclass. Zero Graphics ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

ShadyElyaski/ios-filter-control

开源软件地址:

https://github.com/ShadyElyaski/ios-filter-control

开源编程语言:

Objective-C 98.5%

开源软件介绍:

iOS Filter Control

An iOS Filter UIControl Subclass. Zero Graphics. Highly Customizable.

Inspired by National Geographics: Park Guides.

Screenshot

Here's a screenshot for different variations

ScreenShot

My image

You may watch a demo video on Youtube

Installation

Cocoapods: pod 'SEFilterControl'

Manual:

  1. In your Xcode Project, take the SEFilterControl.h and .m & SEFilterKnob.h and .m from ios-filter-control folder and drag them into your project.

  2. Start using this new UIControl Subclass!

SDK Support

It supports iOS 5 to iOS 8 Live rendering in Interface builder will require Xcode 6.x

Usage

Creating your filter

By Code

Somewhere, for example in your viewDidLoad, alloc and init the filter UIControl:

SEFilterControl *filter = [[SEFilterControl alloc]initWithFrame:CGRectMake(10, 20, 300, 70) Titles:[NSArray arrayWithObjects:@"Articles", @"News", @"Updates", @"Featured", @"Newest", @"Oldest", nil]];

This initializes our Filter Control using CGRect and Titles Array of NSStrings.

Note That height of the control is predefined as 70 and can't be changed Use SEFilterControl_HEIGHT const for reference.

Then, add target for Value Change Event handling:

[filter addTarget:self action:@selector(filterValueChanged:) forControlEvents:UIControlEventValueChanged];

Don't forget to implement the handler we specified later:

-(void)filterValueChanged:(SEFilterControl *) sender{
	NSLog(@"%@", [NSString stringWithFormat:@"%d", sender.SelectedIndex]);
}

Adding to your UIView:

	[self.view addSubview:filter];

Via Interface builder

Add a new UIView to your xib, and update its class to SEFilterControl. Bind a UIAction to the valueChanged event of your control. Enjoy ;)

Configuration

Filter

| Property | Effect | Default value | |:-------------:|-------------|-----|-----| | progressColor | Progress track color | SEFilterControl_DEFAULT_PROGRESS_COLOR | | titlesFont | Configure all titles font | SEFilterControl_DEFAULT_TITLE_FONT | | titlesColor | Configure all titles color | SEFilterControl_DEFAULT_TITLE_COLOR | | titlesShadowColor | Configure all titles shadow color | SEFilterControl_DEFAULT_TITLE_SHADOW_COLOR |

Knob

| Property | Effect | Default value | |:-------------:|-------------| -----|---| | handlerColor | Configure knob color | SEFilterKnob_DEFAULT_HANDLER_COLOR | | shadowColor | Configure knob shadow color | SEFilterKnob_DEFAULT_SHADOW_COLOR | | shadow | Enable / sisable shadow | SEFilterKnob_DEFAULT_SHADOW |

Continuous mode

If continuous is set to YES, filter will generate valueChanged events will user is dragging the knb. If NO, an event will be sent once knob released.

UIAppearance

SEFilterControl and SEFilterKnob declare UIAppearance methods, allowing you to style all instances at a time.

Acknowledgment

Special thanks to mash, Ltd. team for their support.

Thanks to Nicolas Goutaland for the updated version.

License

This Code is released under the MIT License by Shady Elyaski

Would love to hear from you when you use this custom UIControl in your project!

Cheers,

Shady A. Elyaski

http://www.elyaski.com




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap