cdts/xdts-ios 3/TreeHole/CYHResetCode/CYH/QMUIKit/UIKitExtensions/UIControl+QMUI.h

51 lines
3.5 KiB
C
Raw Permalink Normal View History

2023-07-27 09:20:00 +08:00
/**
* Tencent is pleased to support the open source community by making QMUI_iOS available.
* Copyright (C) 2016-2021 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
//
// UIControl+QMUI.h
// qmui
//
// Created by QMUI Team on 15/7/20.
//
#import <UIKit/UIKit.h>
@interface UIControl (QMUI)
/**
* UIControl UIScrollView UIControl UIScrollView 300 UIControl setHighlighted
*
* UIControl.qmui_automaticallyAdjustTouchHighlightedInScrollView YES使 setHighlighted UIScrollView UIControl setHighlighted
*
* @warning 使 UIScrollView.delaysContentTouches UIScrollView.delaysContentTouches NO touch UIScrollView UIControl highlighted
*/
@property(nonatomic, assign) BOOL qmui_automaticallyAdjustTouchHighlightedInScrollView;
/**
UIControl UIControlEventTouchUpInside YES UIControlEventTouchUpInside300ms后再重新点击 UIControlEventTouchUpInside UIControlEventTouchUpInside UIControlEventTouchDownRepeatUIControlEventEditingChanged
@note touch 10s内连续不断地快速点击同一个按钮10s的时间里也只会触发一次 UIControlEventTouchUpInside10s里的所有 touch 1s为临界点10s的快速点击就会触发十次QMUI
@warning @c qmui_automaticallyAdjustTouchHighlightedInScrollView
*/
@property(nonatomic, assign) BOOL qmui_preventsRepeatedTouchUpInsideEvent;
/// setHighlighted: 方法的回调 block
@property(nonatomic, copy) void (^qmui_setHighlightedBlock)(BOOL highlighted);
/// setSelected: 方法的回调 block
@property(nonatomic, copy) void (^qmui_setSelectedBlock)(BOOL selected);
/// setEnabled: 方法的回调 block
@property(nonatomic, copy) void (^qmui_setEnabledBlock)(BOOL enabled);
/// 等同于 addTarget:action:forControlEvents:UIControlEventTouchUpInside
@property(nonatomic, copy) void (^qmui_tapBlock)(__kindof UIControl *sender);
@end