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:
@@ -308,32 +308,25 @@ import SnapKit
|
||||
private func setupLoggedInViewControllers() {
|
||||
// 只在 viewControllers 为空或不是正确类型时才创建
|
||||
if viewControllers?.count != 2 ||
|
||||
!(viewControllers?[0] is EPMomentViewController) ||
|
||||
!(viewControllers?[1] is EPMineViewController) {
|
||||
!(viewControllers?[0] is UINavigationController) ||
|
||||
!(viewControllers?[1] is UINavigationController) {
|
||||
|
||||
// 创建真实的 ViewController(OC 类),并使用导航控制器包裹以显示标题/右上按钮
|
||||
// 创建动态页
|
||||
let momentVC = EPMomentViewController()
|
||||
momentVC.title = "动态"
|
||||
let momentNav = UINavigationController(rootViewController: momentVC)
|
||||
momentNav.navigationBar.isTranslucent = true
|
||||
momentNav.navigationBar.setBackgroundImage(UIImage(), for: .default)
|
||||
momentNav.navigationBar.shadowImage = UIImage()
|
||||
momentNav.view.backgroundColor = .clear
|
||||
momentNav.tabBarItem = createTabBarItem(
|
||||
title: "动态",
|
||||
let momentNav = createTransparentNavigationController(
|
||||
rootViewController: momentVC,
|
||||
tabTitle: "动态",
|
||||
normalImage: "tab_moment_normal",
|
||||
selectedImage: "tab_moment_selected"
|
||||
)
|
||||
|
||||
|
||||
// 创建我的页
|
||||
let mineVC = EPMineViewController()
|
||||
mineVC.title = "我的"
|
||||
let mineNav = UINavigationController(rootViewController: mineVC)
|
||||
mineNav.navigationBar.isTranslucent = true
|
||||
mineNav.navigationBar.setBackgroundImage(UIImage(), for: .default)
|
||||
mineNav.navigationBar.shadowImage = UIImage()
|
||||
mineNav.view.backgroundColor = .clear
|
||||
mineNav.tabBarItem = createTabBarItem(
|
||||
title: "我的",
|
||||
let mineNav = createTransparentNavigationController(
|
||||
rootViewController: mineVC,
|
||||
tabTitle: "我的",
|
||||
normalImage: "tab_mine_normal",
|
||||
selectedImage: "tab_mine_selected"
|
||||
)
|
||||
@@ -344,6 +337,32 @@ import SnapKit
|
||||
|
||||
selectedIndex = 0
|
||||
}
|
||||
|
||||
/// 创建透明导航控制器(统一配置)
|
||||
/// - Parameters:
|
||||
/// - rootViewController: 根视图控制器
|
||||
/// - tabTitle: TabBar 标题
|
||||
/// - normalImage: 未选中图标
|
||||
/// - selectedImage: 选中图标
|
||||
/// - Returns: 配置好的 UINavigationController
|
||||
private func createTransparentNavigationController(
|
||||
rootViewController: UIViewController,
|
||||
tabTitle: String,
|
||||
normalImage: String,
|
||||
selectedImage: String
|
||||
) -> UINavigationController {
|
||||
let nav = UINavigationController(rootViewController: rootViewController)
|
||||
nav.navigationBar.isTranslucent = true
|
||||
nav.navigationBar.setBackgroundImage(UIImage(), for: .default)
|
||||
nav.navigationBar.shadowImage = UIImage()
|
||||
nav.view.backgroundColor = .clear
|
||||
nav.tabBarItem = createTabBarItem(
|
||||
title: tabTitle,
|
||||
normalImage: normalImage,
|
||||
selectedImage: selectedImage
|
||||
)
|
||||
return nav
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - UITabBarControllerDelegate
|
||||
|
Reference in New Issue
Block a user