feat: 添加动态发布功能及相关文档
主要变更: 1. 新增 EPImageUploader.swift 和 EPProgressHUD.swift,提供图片批量上传和进度显示功能。 2. 新建 EPMomentAPISwiftHelper.swift,封装动态 API 的 Swift 版本。 3. 更新 EPMomentPublishViewController,集成新上传功能并实现发布成功通知。 4. 创建多个文档,包括实施报告、检查清单和快速使用指南,详细记录功能实现和使用方法。 5. 更新 Bridging Header,确保 Swift 和 Objective-C 代码的互操作性。 此功能旨在提升用户体验,简化动态发布流程,并提供清晰的文档支持。
This commit is contained in:
@@ -70,8 +70,7 @@
|
||||
// 卡片容器(圆角矩形 + 阴影)
|
||||
[self.contentView addSubview:self.cardView];
|
||||
[self.cardView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.contentView).offset(15);
|
||||
make.right.equalTo(self.contentView).offset(-15);
|
||||
make.leading.trailing.equalTo(self.contentView).inset(15);
|
||||
make.top.equalTo(self.contentView).offset(8);
|
||||
make.bottom.equalTo(self.contentView).offset(-8);
|
||||
}];
|
||||
@@ -79,7 +78,7 @@
|
||||
// 头像(圆角矩形,不是圆形!)
|
||||
[self.cardView addSubview:self.avatarImageView];
|
||||
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.cardView).offset(15);
|
||||
make.leading.equalTo(self.cardView).offset(15);
|
||||
make.top.equalTo(self.cardView).offset(15);
|
||||
make.size.mas_equalTo(CGSizeMake(40, 40));
|
||||
}];
|
||||
@@ -87,39 +86,38 @@
|
||||
// 用户名
|
||||
[self.cardView addSubview:self.nameLabel];
|
||||
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.avatarImageView.mas_right).offset(10);
|
||||
make.leading.equalTo(self.avatarImageView.mas_trailing).offset(10);
|
||||
make.top.equalTo(self.avatarImageView);
|
||||
make.right.equalTo(self.cardView).offset(-15);
|
||||
make.trailing.equalTo(self.cardView).offset(-15);
|
||||
}];
|
||||
|
||||
// 时间
|
||||
[self.cardView addSubview:self.timeLabel];
|
||||
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.nameLabel);
|
||||
make.leading.equalTo(self.nameLabel);
|
||||
make.bottom.equalTo(self.avatarImageView);
|
||||
make.right.equalTo(self.cardView).offset(-15);
|
||||
make.trailing.equalTo(self.cardView).offset(-15);
|
||||
}];
|
||||
|
||||
// 内容
|
||||
[self.cardView addSubview:self.contentLabel];
|
||||
[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.cardView).offset(15);
|
||||
make.right.equalTo(self.cardView).offset(-15);
|
||||
make.leading.trailing.equalTo(self.cardView).inset(15);
|
||||
make.top.equalTo(self.avatarImageView.mas_bottom).offset(12);
|
||||
}];
|
||||
|
||||
// 图片九宫格
|
||||
[self.cardView addSubview:self.imagesContainer];
|
||||
[self.imagesContainer mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.cardView).offset(15);
|
||||
make.right.equalTo(self.cardView).offset(-15);
|
||||
make.leading.trailing.equalTo(self.cardView).inset(15);
|
||||
make.top.equalTo(self.contentLabel.mas_bottom).offset(12);
|
||||
make.height.mas_equalTo(0); // 初始高度为0,renderImages 时会 remakeConstraints
|
||||
}];
|
||||
|
||||
// 底部操作栏
|
||||
[self.cardView addSubview:self.actionBar];
|
||||
[self.actionBar mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(self.cardView);
|
||||
make.leading.trailing.equalTo(self.cardView);
|
||||
make.top.equalTo(self.imagesContainer.mas_bottom).offset(12);
|
||||
make.height.mas_equalTo(50);
|
||||
make.bottom.equalTo(self.cardView).offset(-8);
|
||||
@@ -128,7 +126,7 @@
|
||||
// 点赞按钮
|
||||
[self.actionBar addSubview:self.likeButton];
|
||||
[self.likeButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.actionBar).offset(15);
|
||||
make.leading.equalTo(self.actionBar).offset(15);
|
||||
make.centerY.equalTo(self.actionBar);
|
||||
make.width.mas_greaterThanOrEqualTo(60);
|
||||
}];
|
||||
@@ -178,8 +176,7 @@
|
||||
[self.imageViews removeAllObjects];
|
||||
if (resList.count == 0) {
|
||||
[self.imagesContainer mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.cardView).offset(15);
|
||||
make.right.equalTo(self.cardView).offset(-15);
|
||||
make.leading.trailing.equalTo(self.cardView).inset(15);
|
||||
make.top.equalTo(self.contentLabel.mas_bottom).offset(0);
|
||||
make.height.mas_equalTo(0);
|
||||
}];
|
||||
@@ -203,7 +200,7 @@
|
||||
NSInteger row = i / columns;
|
||||
NSInteger col = i % columns;
|
||||
[iv mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.imagesContainer).offset((itemW + spacing) * col);
|
||||
make.leading.equalTo(self.imagesContainer).offset((itemW + spacing) * col);
|
||||
make.top.equalTo(self.imagesContainer).offset((itemW + spacing) * row);
|
||||
make.size.mas_equalTo(CGSizeMake(itemW, itemW));
|
||||
}];
|
||||
@@ -221,8 +218,7 @@
|
||||
NSInteger rows = ((MIN(resList.count, 9) - 1) / columns) + 1;
|
||||
CGFloat height = rows * itemW + (rows - 1) * spacing;
|
||||
[self.imagesContainer mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.cardView).offset(15);
|
||||
make.right.equalTo(self.cardView).offset(-15);
|
||||
make.leading.trailing.equalTo(self.cardView).inset(15);
|
||||
make.top.equalTo(self.contentLabel.mas_bottom).offset(12);
|
||||
make.height.mas_equalTo(height);
|
||||
}];
|
||||
|
Reference in New Issue
Block a user