Board logo

标题: HMSegmentedControl源代码解析(5) [打印本页]

作者: look_w    时间: 2019-2-19 17:35     标题: HMSegmentedControl源代码解析(5)

segment

    //
    //  HMSegmentedControl.m
    //  HMSegmentedControl
    //
    //  Created by Hesham Abd-Elmegid on 23/12/12.
    //  Copyright (c) 2012-2015 Hesham Abd-Elmegid. All rights reserved.
    //
     
    #import "HMSegmentedControl.h"
    #import <QuartzCore/QuartzCore.h>
    #import <math.h>
     
    @interface HMScrollView : UIScrollView
    @end
     
     
    @implementation HMScrollView
     
    - (void)touchesBeganNSSet<UITouch *> *)touches withEventUIEvent *)event {
        if (!self.dragging) {
            [self.nextResponder touchesBegan:touches withEvent:event];
        } else {
            [super touchesBegan:touches withEvent:event];
        }
    }
     
    - (void)touchesMovedNSSet<UITouch *> *)touches withEventUIEvent *)event{
        if (!self.dragging) {
            [self.nextResponder touchesMoved:touches withEvent:event];
        } else{
            [super touchesMoved:touches withEvent:event];
        }
    }
     
    - (void)touchesEndedNSSet<UITouch *> *)touches withEventUIEvent *)event {
        if (!self.dragging) {
            [self.nextResponder touchesEnded:touches withEvent:event];
        } else {
            [super touchesEnded:touches withEvent:event];
        }
    }
     
    @end




欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0