欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

iOS SHSetGoalClass Slider时间滑动自定义控件(封装demo)

程序员文章站 2022-03-08 14:26:27
联系人:石虎 QQ:1224614774昵称:嗡嘛呢叭咪哄 QQ群:807236138群称:iOS 技术交流学习群一、概念在外界直接一行代码实现 #import "SHSetGoalView.h" @property (nonatomic, strong) SHSetGoalView *setGoalView; - (void)viewDidLoad { [supe......

概念

在外界直接一行代码实现

 #import "SHSetGoalView.h"
       @property (nonatomic, strong) SHSetGoalView *setGoalView;

       - (void)viewDidLoad {
           [super viewDidLoad];
            self.view.backgroundColor = [UIColor whiteColor];
            [self.view addSubview:self.setGoalView];
       }
 
 
       #pragma mark -
       #pragma mark - Getter Method
       - (SHSetGoalView *)setGoalView{
           if (!_setGoalView) {
               _setGoalView = [[SHSetGoalView alloc] initWithFrame:CGRectMake(0, 100, [[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height)];
               __weak typeof(self) weakSelf = self;
               _setGoalView.datePickerBlock = ^(UIView * _Nonnull datePicker) {
                    [weakSelf.view addSubview:datePicker];
               };
           }
           return _setGoalView;
       }

二、demo 效果图

下载 GitHub demo https://github.com/shihu132/SHDownListMenu

下载 码云 demo https://gitee.com/ShiHu132/SHSetGoalClass

注意:demo中有动画效果图

iOS SHSetGoalClass Slider时间滑动自定义控件(封装demo)

三、 仿界面实现截图

iOS SHSetGoalClass Slider时间滑动自定义控件(封装demo)

本文地址:https://blog.csdn.net/shihuboke/article/details/107711330