cdts/xdts-ios 3/TreeHole/CYHResetCode/CYH/QMUIKit/QMUIComponents/QMUITextField.h

105 lines
5.3 KiB
C
Raw 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.
*/
//
// QMUITextField.h
// qmui
//
// Created by QMUI Team on 16-11-03
//
#import <UIKit/UIKit.h>
@class QMUITextField;
@protocol QMUITextFieldDelegate <UITextFieldDelegate>
@optional
/**
maximumTextLength shouldChangeCharacters maximumTextLength delegate QMUI YES delegate QMUI NO maximumTextLength
textField:didPreventTextChangeInRange:replacementString: tips return NO
*/
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string originalValue:(BOOL)originalValue;
/**
* `maximumTextLength` 使
* @warning UIControlEventEditingChanged textField range replacementString
*
* @param textField textField
* @param range UIControlEventEditingChanged range range
* @param replacementString UIControlEventEditingChanged nil
*/
- (void)textField:(QMUITextField *)textField didPreventTextChangeInRange:(NSRange)range replacementString:(NSString *)replacementString;
@end
/**
*
*
* 1. placeholderColor
* 2. UITextField padding
* 3.
* 4. iOS 10 UITextField bug
*/
@interface QMUITextField : UITextField
@property(nonatomic, weak) id<QMUITextFieldDelegate> delegate;
/**
* placeholder UIColorPlaceholder
*/
@property(nonatomic, strong) IBInspectable UIColor *placeholderColor;
/**
* padding clearButton textInsets.right clearButton
*
* TextFieldTextInsets
*/
@property(nonatomic, assign) UIEdgeInsets textInsets;
/**
clearButton
*/
@property(nonatomic, assign) UIOffset clearButtonPositionAdjustment UI_APPEARANCE_SELECTOR;
/**
* `setText:``setAttributedText:` UIControlEventEditingChanged UITextFieldTextDidChangeNotification
*
* YES UITextField NO
*/
@property(nonatomic, assign) IBInspectable BOOL shouldResponseToProgrammaticallyTextChanges;
/**
* NSUIntegerMax
*/
@property(nonatomic, assign) IBInspectable NSUInteger maximumTextLength;
/**
* 使 maximumTextLength [NSString (QMUI) qmui_lengthWhenCountingNonASCIICharacterAsTwo]
* NO
*/
@property(nonatomic, assign) IBInspectable BOOL shouldCountingNonASCIICharacterAsTwo;
/**
* menu
* @param sender
* @param superReturnValue [super canPerformAction:withSender:] block superReturnValue
* @return menuYES NO superReturnValue
*/
@property(nonatomic, copy) BOOL (^canPerformPasteActionBlock)(id sender, BOOL superReturnValue);
/**
* block
* @param sender UIMenuController
* @return paste: YES block NO block super
*/
@property(nonatomic, copy) BOOL (^pasteBlock)(id sender);
@end