chore: Initial clean commit

- Removed YuMi/Library/ (138 MB, not tracked)
- Removed YuMi/Resources/ (23 MB, not tracked)
- Removed old version assets (566 files, not tracked)
- Excluded Pods/, xcuserdata/ and other build artifacts
- Clean repository optimized for company server deployment
This commit is contained in:
edwinQQQ
2025-10-09 16:19:14 +08:00
commit a35a711be6
5582 changed files with 408913 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
//
// TTActionSheetView.h
// YM_TTChatViewKit
//
// Created by lee on 2019/5/22.
// Copyright © 2023 YUMI. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "TTPopupConstants.h"
NS_ASSUME_NONNULL_BEGIN
@class TTActionSheetConfig;
@interface TTActionSheetView : UIView
@property (nonatomic, copy) TTPopupCompletionHandler cancelAction;
@property (nonatomic, copy) TTPopupCompletionHandler dismissAction;
- (instancetype)initWithFrame:(CGRect)frame
needCancel:(BOOL)needCancel
items:(NSArray<TTActionSheetConfig *> *)items;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,159 @@
//
// TTActionSheetView.m
// YM_TTChatViewKit
//
// Created by lee on 2019/5/22.
// Copyright © 2023 YUMI. All rights reserved.
//
#import "TTActionSheetView.h"
#import "TTActionSheetConfig.h"
#import "DJDKMIMOMColor.h"
#import <Masonry/Masonry.h>
static CGFloat const kSheetViewCellHeight = 51.f;
static CGFloat const kSheetViewCornerRadius = 14.f;
static NSString *const kSheetViewCellConst = @"kSheetViewCellConst";
@interface TTActionSheetView ()<UITableViewDelegate, UITableViewDataSource>
/** sheetView */
@property (nonatomic, strong) UITableView *tableView;
/** */
@property (nonatomic, strong) NSArray<TTActionSheetConfig *> *items;
/** */
@property (nonatomic, assign) BOOL needCancel;
/** */
@property (nonatomic, strong) UIButton *cancelButton;
@end
@implementation TTActionSheetView
#pragma mark -
#pragma mark lifeCycle
- (instancetype)initWithFrame:(CGRect)frame needCancel:(BOOL)needCancel items:(NSArray<TTActionSheetConfig *> *)items {
self = [super initWithFrame:frame];
if (self) {
_items = items;
_needCancel = needCancel;
[self initViews];
[self initConstraints];
}
return self;
}
- (void)initViews {
[self addSubview:self.tableView];
[self addSubview:self.cancelButton];
}
- (void)initConstraints {
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.top.mas_equalTo(self);
make.height.mas_equalTo(self.items.count * kSheetViewCellHeight);
}];
if (_needCancel) {
// cancel view
self.cancelButton.hidden = NO;
[self.cancelButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.mas_equalTo(self);
make.height.mas_equalTo(kSheetViewCellHeight);
make.top.mas_equalTo(self.tableView.mas_bottom).offset(15);
}];
}
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.items.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kSheetViewCellConst];
cell.backgroundColor = UIColor.clearColor;
cell.textLabel.textAlignment = NSTextAlignmentCenter;
cell.textLabel.text = _items[indexPath.row].title;
cell.textLabel.textColor = _items[indexPath.row].titleColor;
if ([_items[indexPath.row] displayMoliCoin]) {
NSTextAttachment *coinAttachment = [[NSTextAttachment alloc] init];
coinAttachment.image = kImage(@"moli_money_icon");
coinAttachment.bounds = CGRectMake(0, -3.5, 20, 20);
NSAttributedString *coinAttributedString = [NSAttributedString attributedStringWithAttachment:coinAttachment];
NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithAttributedString:coinAttributedString];
NSAttributedString *titleAttributedString = [[NSAttributedString alloc] initWithString:_items[indexPath.row].title
attributes:@{
NSForegroundColorAttributeName: _items[indexPath.row].titleColor,
NSFontAttributeName: cell.textLabel.font
}];
[string insertAttributedString:titleAttributedString atIndex:0];
cell.textLabel.attributedText = string.copy;
UIImageView *questionMark = [[UIImageView alloc] initWithImage:kImage(@"question_mark")];
[cell.contentView addSubview:questionMark];
[questionMark mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(cell.textLabel);
make.trailing.mas_equalTo(-20);
make.size.mas_equalTo(CGSizeMake(22, 22));
}];
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
//
TTActionSheetConfig *config = _items[indexPath.row];
!config.clickAction ?: config.clickAction();
!_dismissAction ?: _dismissAction();
}
- (void)onClickCancelButtonAction:(UIButton *)cancelButton {
!_cancelAction ?: _cancelAction();
!_dismissAction ?: _dismissAction();
}
- (UITableView *)tableView {
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.separatorColor = [DJDKMIMOMColor actionSeparatorColor];
_tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
_tableView.rowHeight = kSheetViewCellHeight;
_tableView.tableFooterView = [[UIView alloc] init];
_tableView.backgroundColor = [UIColor whiteColor];
_tableView.layer.cornerRadius = kSheetViewCornerRadius;
_tableView.layer.masksToBounds = YES;
_tableView.bounces = NO;
[_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kSheetViewCellConst];
}
return _tableView;
}
- (UIButton *)cancelButton {
if (!_cancelButton) {
_cancelButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_cancelButton setTitle:YMLocalizedString(@"TTActionSheetView0") forState:UIControlStateNormal];
[_cancelButton setBackgroundColor:UIColor.whiteColor];
[_cancelButton setTitleColor:[DJDKMIMOMColor alertMessageColor] forState:UIControlStateNormal];
[_cancelButton.titleLabel setFont:[UIFont systemFontOfSize:16]];
_cancelButton.layer.cornerRadius = kSheetViewCornerRadius;
_cancelButton.layer.masksToBounds = YES;
[_cancelButton addTarget:self action:@selector(onClickCancelButtonAction:) forControlEvents:UIControlEventTouchUpInside];
_cancelButton.hidden = YES;
}
return _cancelButton;
}
@end

View File

@@ -0,0 +1,25 @@
//
// TTAlertView.h
// YM_TTChatViewKit
//
// Created by lee on 2019/5/20.
// Copyright © 2023 YUMI. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "TTPopupConstants.h"
@class TTAlertConfig;
NS_ASSUME_NONNULL_BEGIN
@interface TTAlertView : UIView
@property (nonatomic, strong) TTAlertConfig *config;// 配置
@property (nonatomic, assign) BOOL isConfigBoard;// 是否配置边框
@property (nonatomic, copy) TTPopupCompletionHandler cancelAction;
@property (nonatomic, copy) TTPopupCompletionHandler confirmAction;
@property (nonatomic, copy) TTPopupCompletionHandler dismissAction;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,255 @@
//
// TTAlertView.m
// YM_TTChatViewKit
//
// Created by lee on 2019/5/20.
// Copyright © 2023 YUMI. All rights reserved.
//
#import "TTAlertView.h"
#import "TTAlertConfig.h"
#import "DJDKMIMOMColor.h"
#import <Masonry/Masonry.h>
static CGFloat const kMargin = 25.f;
static CGFloat const kPadding = 20.f;
static CGFloat const kBtnHeight = 38.f;
@interface TTAlertView ()
@property (nonatomic, strong) UILabel *titleLabel; //
@property (nonatomic, strong) UILabel *messageLabel; //
@property (nonatomic, strong) UIButton *cancelButton; //
@property (nonatomic, strong) UIButton *confirmButton; //
@property (nonatomic, strong) UIStackView *stackView;
@end
@implementation TTAlertView
#pragma mark - lifeCyle
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initViews];
[self initConstraints];
}
return self;
}
- (void)initViews {
[self addSubview:self.titleLabel];
[self addSubview:self.messageLabel];
[self addSubview:self.stackView];
[self.stackView addSubview:self.cancelButton];
[self.stackView addSubview:self.confirmButton];
}
- (void)initConstraints {
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self);
make.top.mas_equalTo(kPadding);
make.leading.trailing.mas_equalTo(self).inset(kPadding);
}];
[self.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(kMargin);
make.leading.trailing.mas_equalTo(self).inset(kPadding);
make.bottom.mas_equalTo(self).offset(-kBtnHeight * 2);
}];
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(-kPadding);
make.centerX.mas_equalTo(self);
}];
[self.cancelButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(kBtnHeight);
make.width.mas_equalTo(self.mas_width).multipliedBy(0.4);
}];
[self.confirmButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(kBtnHeight);
make.width.mas_equalTo(self.mas_width).multipliedBy(0.4);
}];
}
#pragma mark - Button Events
- (void)onClickConfirmButtonAction:(UIButton *)confirmButton {
!_confirmAction ?: _confirmAction();
!_dismissAction ?: _dismissAction();
}
- (void)onClickCancelButtonAction:(UIButton *)cancelButton {
!_cancelAction ?: _cancelAction();
!_dismissAction ?: _dismissAction();
}
#pragma mark - private method
/**
messageLabel
@param config
@return
*/
- (NSMutableAttributedString *)messageAttributeString:(TTAlertConfig *)config {
NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:config.message];
if (config.messageLineSpacing > 0) { //
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineSpacing = config.messageLineSpacing;
paragraphStyle.alignment = config.messageTextAlignment;
[attString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, config.message.length)];
}
//
[config.messageAttributedConfig enumerateObjectsUsingBlock:^(TTAlertMessageAttributedConfig * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
//
if ([obj isKindOfClass:[TTAlertMessageAttributedConfig class]]) {
if (obj.text && obj.text.length > 0) {
NSRange range = [config.message rangeOfString:obj.text];
// range range
if (obj.range.length != 0) {
if (obj.range.location + obj.range.length > config.message.length) {
NSAssert(NO, @"obj.range out of bounds");
return;
}
range = obj.range;
}
if (obj.font) { //
[attString addAttribute:NSFontAttributeName value:obj.font range:range];
}
if (obj.color) { //
[attString addAttribute:NSForegroundColorAttributeName value:obj.color range:range];
}
}
}
}];
return attString;
}
#pragma mark - getter && setter
- (void)setConfig:(TTAlertConfig *)config {
_config = config;
// cornerRadius
if (config.cornerRadius > 0) {
self.layer.cornerRadius = config.cornerRadius;
self.layer.masksToBounds = YES;
}
//
self.backgroundColor = config.backgroundColor;
// title
_titleLabel.text = config.title;
_titleLabel.textColor = config.titleColor;
_titleLabel.font = config.titleFont;
_cancelButton.hidden = config.actionStyle == TTAlertActionConfirmStyle;
_confirmButton.hidden = config.actionStyle == TTAlertActionCancelStyle;
// cancel button
[_cancelButton setTitle:config.cancelButtonConfig.title forState:UIControlStateNormal];
[_cancelButton setTitleColor:config.cancelButtonConfig.titleColor forState:UIControlStateNormal];
[_cancelButton.titleLabel setFont:config.cancelButtonConfig.font];
[_cancelButton setBackgroundColor:config.cancelButtonConfig.backgroundColor];
[_cancelButton setBackgroundImage:config.cancelButtonConfig.backgroundImage forState:UIControlStateNormal];
if (config.cancelButtonConfig.cornerRadius > 0) {
_cancelButton.layer.cornerRadius = config.cancelButtonConfig.cornerRadius;
_cancelButton.layer.masksToBounds = YES;
}
// confirm button
[_confirmButton setTitle:config.confirmButtonConfig.title forState:UIControlStateNormal];
[_confirmButton setTitleColor:config.confirmButtonConfig.titleColor forState:UIControlStateNormal];
[_confirmButton.titleLabel setFont:config.confirmButtonConfig.font];
[_confirmButton setBackgroundColor:config.confirmButtonConfig.backgroundColor];
[_confirmButton setBackgroundImage:config.confirmButtonConfig.backgroundImage forState:UIControlStateNormal];
if (config.confirmButtonConfig.cornerRadius > 0) {
_confirmButton.layer.cornerRadius = config.confirmButtonConfig.cornerRadius;
_confirmButton.layer.masksToBounds = YES;
}
// message
_messageLabel.font = config.messageFont;
_messageLabel.textColor = config.messageColor;
if (config.messageAttributedConfig.count > 0) {
_messageLabel.attributedText = [self messageAttributeString:config];
_messageLabel.textAlignment = NSTextAlignmentCenter;
} else if(config.messageAttributed.length > 0) {
_messageLabel.attributedText = config.messageAttributed;
_messageLabel.textAlignment = NSTextAlignmentCenter;
} else {
_messageLabel.text = config.message;
_messageLabel.textAlignment = config.messageTextAlignment;
}
_cancelButton.layer.borderColor = [DJDKMIMOMColor dividerColor].CGColor;
_cancelButton.layer.borderWidth = 2.f;
_confirmButton.layer.borderColor = [DJDKMIMOMColor dividerColor].CGColor;
_confirmButton.layer.borderWidth = 2.f;
}
- (void)setIsConfigBoard:(BOOL)isConfigBoard {
_isConfigBoard = isConfigBoard;
if (isConfigBoard) {
//
_cancelButton.layer.borderColor = [DJDKMIMOMColor dividerColor].CGColor;
_cancelButton.layer.borderWidth = 2.f;
_confirmButton.layer.borderColor = [DJDKMIMOMColor dividerColor].CGColor;
_confirmButton.layer.borderWidth = 2.f;
}else {
//
_cancelButton.layer.borderColor = [DJDKMIMOMColor dividerColor].CGColor;
_cancelButton.layer.borderWidth = 0;
_confirmButton.layer.borderColor = [DJDKMIMOMColor dividerColor].CGColor;
_confirmButton.layer.borderWidth = 0;
}
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.textAlignment = NSTextAlignmentCenter;
_titleLabel.numberOfLines = 0;
}
return _titleLabel ;
}
- (UILabel *)messageLabel {
if (!_messageLabel) {
_messageLabel = [[UILabel alloc] init];
_messageLabel.numberOfLines = 0;
_messageLabel.textAlignment = NSTextAlignmentCenter;
_messageLabel.minimumScaleFactor = 0.7;
_messageLabel.adjustsFontSizeToFitWidth = YES;
}
return _messageLabel;
}
- (UIButton *)cancelButton {
if (!_cancelButton) {
_cancelButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_cancelButton addTarget:self action:@selector(onClickCancelButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _cancelButton;
}
- (UIButton *)confirmButton {
if (!_confirmButton) {
_confirmButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_confirmButton addTarget:self action:@selector(onClickConfirmButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _confirmButton;
}
- (UIStackView *)stackView {
if (!_stackView) {
_stackView = [[UIStackView alloc] initWithArrangedSubviews:@[self.cancelButton, self.confirmButton]];
_stackView.distribution = UIStackViewDistributionFillEqually;
_stackView.alignment = UIStackViewAlignmentCenter;
_stackView.spacing = 16;
}
return _stackView;
}
@end

View File

@@ -0,0 +1,20 @@
//
// TTNewAlertView.h
// xplan-ios
//
// Created by duoban on 2023/1/9.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface TTNewAlertView : UIView
@property (nonatomic,copy) NSString *message;
@property (nonatomic, copy) TTPopupCompletionHandler confirmHandle;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,118 @@
//
// TTNewAlertView.m
// xplan-ios
//
// Created by duoban on 2023/1/9.
//
#import "TTNewAlertView.h"
@interface TTNewAlertView()
@property (nonatomic,strong) UIView *bgView;
@property (nonatomic,strong) UILabel *messageView;
@property (nonatomic,strong) UIButton *confirmBtn;
@property (nonatomic,strong) UIButton *cancelBtn;
@end
@implementation TTNewAlertView
-(instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if(self){
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
self.backgroundColor = [UIColor clearColor];
[self addSubview:self.bgView];
[self.bgView addSubview:self.messageView];
[self.bgView addSubview:self.confirmBtn];
[self.bgView addSubview:self.cancelBtn];
}
- (void)initSubViewConstraints {
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(310));
make.height.mas_equalTo(kGetScaleWidth(149));
make.center.equalTo(self);
}];
[self.confirmBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(kGetScaleWidth(110));
make.height.mas_equalTo(kGetScaleWidth(37));
make.leading.mas_equalTo(kGetScaleWidth(31));
make.bottom.mas_equalTo(-kGetScaleWidth(31));
}];
[self.cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.centerY.equalTo(self.confirmBtn);
make.trailing.mas_equalTo(-kGetScaleWidth(31));
}];
[self.messageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(25));
make.centerX.equalTo(self);
make.leading.trailing.equalTo(self).inset(kGetScaleWidth(10));
}];
}
-(void)setMessage:(NSString *)message{
_message = message;
_messageView.text = message;
}
-(void)confirmAction{
[TTPopup dismiss];
if(self.confirmHandle){
self.confirmHandle();
}
}
-(void)cancelAction{
[TTPopup dismiss];
}
#pragma mark -
- (UIView *)bgView{
if (!_bgView){
_bgView = [UIView new];
_bgView.backgroundColor = [UIColor whiteColor];
[_bgView setCornerWithLeftTopCorner:kGetScaleWidth(12) rightTopCorner:kGetScaleWidth(12) bottomLeftCorner:kGetScaleWidth(12) bottomRightCorner:kGetScaleWidth(12) size:CGSizeMake(kGetScaleWidth(310), kGetScaleWidth(149))];
}
return _bgView;
}
- (UILabel *)messageView{
if (!_messageView){
_messageView = [UILabel labelInitWithText:@"" font:kFontRegular(15) textColor:[DJDKMIMOMColor inputTextColor]];
_messageView.textAlignment = NSTextAlignmentCenter;
_messageView.numberOfLines = 0;
}
return _messageView;
}
-(UIButton *)confirmBtn{
if (!_confirmBtn){
_confirmBtn = [UIButton new];
[_confirmBtn setTitle:YMLocalizedString(@"TTAlertConfig0") forState:UIControlStateNormal];
_confirmBtn.backgroundColor = UIColorFromRGB(0xE6E6F0);
_confirmBtn.layer.cornerRadius = kGetScaleWidth(37)/2;
_confirmBtn.layer.masksToBounds = YES;
[_confirmBtn addTarget:self action:@selector(confirmAction) forControlEvents:UIControlEventTouchUpInside];
}
return _confirmBtn;
}
-(UIButton *)cancelBtn{
if (!_cancelBtn){
_cancelBtn = [UIButton new];
[_cancelBtn setTitle:YMLocalizedString(@"XPShareView7") forState:UIControlStateNormal];
UIImage *image = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor],[DJDKMIMOMColor confirmButtonGradientMiddleColor],[DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(110), kGetScaleWidth(37))];
_cancelBtn.backgroundColor = [UIColor colorWithPatternImage:image];
_cancelBtn.layer.cornerRadius = kGetScaleWidth(37)/2;
_cancelBtn.layer.masksToBounds = YES;
[_cancelBtn addTarget:self action:@selector(cancelAction) forControlEvents:UIControlEventTouchUpInside];
}
return _cancelBtn;
}
@end