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

120 lines
6.3 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.
*/
//
// QMUITextView.h
// qmui
//
// Created by QMUI Team on 14-8-5.
//
#import <UIKit/UIKit.h>
@class QMUITextView;
@protocol QMUITextViewDelegate <UITextViewDelegate>
@optional
/**
* delegate
* @note
*/
- (void)textView:(QMUITextView *)textView newHeightAfterTextChanged:(CGFloat)height;
/**
* return return \n
* @return YES \n NO textView:shouldChangeTextInRange:replacementText: \n
* @see maximumTextLength
*/
- (BOOL)textViewShouldReturn:(QMUITextView *)textView;
/**
maximumTextLength shouldChangeCharacters maximumTextLength delegate QMUI YES delegate QMUI NO maximumTextLength
textView:didPreventTextChangeInRange:replacementText: tips return NO
*/
- (BOOL)textView:(QMUITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text originalValue:(BOOL)originalValue;
/**
* `maximumTextLength` 使
*
* @param textView textView
* @param range length > 0
* @param replacementText
*/
- (void)textView:(QMUITextView *)textView didPreventTextChangeInRange:(NSRange)range replacementText:(NSString *)replacementText;
@end
/**
* UITextView
*
* 1. placeholder placeholderColor使 placeholder placeholder
* 2. delegate
* 3. 2 使
* 4.
* 5. UITextView contentOffset textContainerInset.bottom
*/
@interface QMUITextView : UITextView
@property(nonatomic, weak) id<QMUITextViewDelegate> delegate;
/**
* `setText:``setAttributedText:` `UITextViewDelegate` `textView:shouldChangeTextInRange:replacementText:` `textViewDidChange:`
*
* YES UITextView 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;
/**
* placeholder
*/
@property(nonatomic, copy) IBInspectable NSString *placeholder;
/**
* placeholder
*/
@property(nonatomic, strong) IBInspectable UIColor *placeholderColor;
/**
* placeholder textContainerInsetcontentInset
*/
@property(nonatomic, assign) UIEdgeInsets placeholderMargins;
/**
* frame CGFLOAT_MAX
*/
@property(nonatomic, assign) CGFloat maximumHeight;
/**
* 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