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

98 lines
4.7 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.
*/
//
// QMUITableViewCell.h
// qmui
//
// Created by QMUI Team on 14-7-7.
//
#import <UIKit/UIKit.h>
#import "UITableView+QMUI.h"
NS_ASSUME_NONNULL_BEGIN
@interface QMUITableViewCell : UITableViewCell
@property(nonatomic, assign, readonly) UITableViewCellStyle style;
/**
* imageView imageView textLabel UIEdgeInsetsZero
* @warning UITableViewCellStyleDefault UITableViewCellStyleSubtitle cell
*/
@property(nonatomic, assign) UIEdgeInsets imageEdgeInsets;
/**
* textLabel UIEdgeInsetsZero
* @warning UITableViewCellStyleDefault UITableViewCellStyleSubtitle cell
*/
@property(nonatomic, assign) UIEdgeInsets textLabelEdgeInsets;
/// 调整 detailTextLabel 的位置偏移,默认为 UIEdgeInsetsZero。
@property(nonatomic, assign) UIEdgeInsets detailTextLabelEdgeInsets;
/**
accessoryView UIEdgeInsetsZero
@warning view i TableViewCellDisclosureIndicatorImage使 accessoryView
*/
@property(nonatomic, assign) UIEdgeInsets accessoryEdgeInsets;
/**
accessoryView (-12, -12, -12, -12)
@warning view i TableViewCellDetailButtonImage使 accessoryView
*/
@property(nonatomic, assign) UIEdgeInsets accessoryHitTestEdgeInsets;
/// 设置当前 cell 是否可用setter 方法里面会修改当前的 subviews 样式,以展示出禁用的样式,具体样式请查看源码。
@property(nonatomic, assign, getter = isEnabled) BOOL enabled;
/// 保存对 tableView 的弱引用,在布局时可能会使用到 tableView 的一些属性例如 separatorColor 等
@property(nonatomic, weak, nullable) __kindof UITableView *parentTableView;
/**
* cell section
* 1. cell 使 initForTableViewXxx parentTableView
* 2. cellForRow [cell updateCellAppearanceWithIndexPath:]
* 3. cellPosition
*
* @note UITableViewCell(QMUI) qmui_cellPosition willDisplayCell cellForRow QMUITableViewCell cellPosition
*/
@property(nonatomic, assign, readonly) QMUITableViewCellPosition cellPosition;
/**
*
*
* @param tableView cell所在的tableView
* @param style tableView的style
* @param reuseIdentifier tableView的reuseIdentifier
*
* @return QMUITableViewCell实例
*/
- (nullable instancetype)initForTableView:(nullable UITableView *)tableView withStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier;
/// 同上
- (nullable instancetype)initForTableView:(nullable UITableView *)tableView withReuseIdentifier:(NSString *)reuseIdentifier;
@end
@interface QMUITableViewCell (QMUISubclassingHooks)
/**
* NS_DESIGNATED_INITIALIZER NS_DESIGNATED_INITIALIZER NS_DESIGNATED_INITIALIZER
*/
- (void)didInitializeWithStyle:(UITableViewCellStyle)style NS_REQUIRES_SUPER;
/// 用于继承的接口设置一些cell相关的UI需要自 cellForRowAtIndexPath 里面调用。默认实现是设置当前cell在哪个position。
- (void)updateCellAppearanceWithIndexPath:(nullable NSIndexPath *)indexPath NS_REQUIRES_SUPER;
@end
NS_ASSUME_NONNULL_END