[翻译] MGConferenceDatePicker

简介:

MGConferenceDatePicker

https://github.com/matteogobbi/MGConferenceDatePicker

 

MGConferenceDatePicker is an object wich extend a UIView furnishing a very nice type of data picker.

MGConferenceDatePicker是一个对象,扩展了UIView并展示出一个样式华丽的时间选择器.

 

Info

This code must be used under ARC. If your code doesn't use ARC you can mark this source with the compiler flag -fobjc-arc

这份代码是在ARC下使用的.如果你的项目不支持ARC,你可以加一个编译标签-fobjc-arc

 

Example Usage

In the package is included the project to test the object. This is an easy example to init the control from code:

zip包中已经包含了使用样例,使用起来是非常简单的:

    //New view controller
    UIViewController *pickerViewController = [[UIViewController alloc] init]; //Init the datePicker view and set self as delegate MGConferenceDatePicker *datePicker = [[MGConferenceDatePicker alloc] initWithFrame:self.view.bounds]; [datePicker setDelegate:self]; //OPTIONAL: Choose the background color [datePicker setBackgroundColor:[UIColor whiteColor]]; //Set the data picker as view of the new view controller [pickerViewController setView:datePicker]; //Present the view controller [self presentViewController:pickerViewController animated:YES completion:nil]; 

Or you are also able to set the view directly in the NIB or in the XIB file and simply just set the delegate from code.

See the example's project.

或者,你也可以将这个view直接设置到NIB或者XIB文件中,在代码中设置代理即可.

 

 

附录:

-以下是封装的一些细节-

一个文件中封装了3个类:

界面上的选择由4个scrollView组成:

总结:

这个MGConferenceDatePicker极具学习价值:)

目录
相关文章
|
存储 自然语言处理 前端开发
从零写一个Recoil(翻译)
Rewriting Recoil from scratchrecoil是facebook编写的一个库,它之所以诞生是因为人体工程学、context的性能问题和useState。这是一个非常聪明的库,几乎每个人都会找到它的用途——如果你想了解更多,请查看这段解释视频。刚开始我被图论和recoil惊到了,但渐渐的理解后,感觉也没那么特别了。也许我也可以实现一个类似的东西。我自己实现的版本和recoil
238 0
从零写一个Recoil(翻译)
|
Java iOS开发
|
iOS开发 Perl
|
iOS开发 Perl 文件存储