PQStuckPointMaterialController.swift 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. //
  2. // PQStuckPointMaterialController.swift
  3. // PQSpeed
  4. //
  5. // Created by SanW on 2021/4/26.
  6. // Copyright © 2021 BytesFlow. All rights reserved.
  7. //
  8. import UIKit
  9. import Photos
  10. import BFUIKit
  11. import BFMaterialKit
  12. public class PQStuckPointMaterialController: BFBaseViewController {
  13. public var isToPublicHandle:((_ isReCreate:Bool,_ selectedTotalDuration: Float64,_ selectedDataCount:Int,_ selectedImageDataCount: Int,_ mStickers: [PQEditVisionTrackMaterialsModel]?,_ stuckPointMusicData: PQVoiceModel?,_ editProjectModel: PQEditProjectModel?) -> Void)?
  14. // 按钮高
  15. let choseBtnH: CGFloat = cDefaultMargin * 3
  16. // 按钮宽
  17. let choseBtnW: CGFloat = cDefaultMargin * 5
  18. // 操作视图高度
  19. let topImageH: CGFloat = 76
  20. // 底部操作视图高度
  21. let bottomH: CGFloat = cDefaultMargin * 5
  22. // 间隔
  23. let margin: CGFloat = 12
  24. // 选择的总数
  25. var selectedDataCount: Int = 0
  26. // 选择的图片总数
  27. var selectedImageDataCount: Int = 0
  28. // 再创作音乐数据
  29. public var reCreateMusicData: PQVoiceModel?
  30. public var reCreateVideoData: PQReCreateModel? // 再创作数据
  31. lazy var changeCollecBtn: UIButton = {
  32. let changeCollecBtn = UIButton(frame: CGRect(x: cDefaultMargin * 5, y: cDevice_iPhoneStatusBarHei, width: cScreenWidth - cDefaultMargin * 10, height: cDefaultMargin * 4))
  33. changeCollecBtn.titleLabel?.lineBreakMode = .byTruncatingTail
  34. changeCollecBtn.tintColor = PQBFConfig.shared.styleTitleColor
  35. changeCollecBtn.setTitle("我的相册", for: .normal)
  36. changeCollecBtn.setImage(UIImage.moduleImage(named: "icon_selected_down", moduleName: "BFFramework",isAssets: false)?.withRenderingMode(.alwaysTemplate), for: .normal)
  37. changeCollecBtn.setImage(UIImage.moduleImage(named: "icon_selected_up", moduleName: "BFFramework",isAssets: false)?.withRenderingMode(.alwaysTemplate), for: .selected)
  38. changeCollecBtn.setTitleColor(PQBFConfig.shared.styleTitleColor, for: .normal)
  39. changeCollecBtn.titleLabel?.font = UIFont.systemFont(ofSize: 18, weight: .medium)
  40. changeCollecBtn.tag = 1
  41. changeCollecBtn.imagePosition(at: PQButtonImageEdgeInsetsStyle.right, space: cDefaultMargin / 2)
  42. changeCollecBtn.addTarget(self, action: #selector(btnClick(sender:)), for: .touchUpInside)
  43. return changeCollecBtn
  44. }()
  45. lazy var albumController: BFPhotoAlbumController = {
  46. let albumController = BFPhotoAlbumController()
  47. albumController.isTopShow = true
  48. albumController.categoryH = cDefaultMargin * 40
  49. addChild(albumController)
  50. view.insertSubview(albumController.view, belowSubview: navHeadImageView!)
  51. albumController.updateViewFrame(frame: CGRect(x: 0, y: navHeadImageView?.frame.maxY ?? cDevice_iPhoneNavBarAndStatusBarHei, width: view.frame.width, height: view.frame.height - (navHeadImageView?.frame.maxY ?? cDevice_iPhoneNavBarAndStatusBarHei)))
  52. albumController.selectedHandle = { [weak self] seletedData in
  53. self?.albumSelectedHandle(seletedData: seletedData)
  54. }
  55. return albumController
  56. }()
  57. lazy var choseLocalAllBtn: UIButton = {
  58. let choseLocalAllBtn = UIButton(frame: CGRect(x: (view.frame.width - choseBtnW * 3) / 4, y: cDevice_iPhoneNavBarAndStatusBarHei + margin, width: choseBtnW, height: choseBtnH))
  59. choseLocalAllBtn.setTitleColor(UIColor.hexColor(hexadecimal: "#999999"), for: .normal)
  60. choseLocalAllBtn.setTitleColor(PQBFConfig.shared.styleTitleColor, for: .selected)
  61. choseLocalAllBtn.setTitle("全部", for: .normal)
  62. choseLocalAllBtn.titleLabel?.font = UIFont.systemFont(ofSize: 17, weight: .medium)
  63. choseLocalAllBtn.addCorner(corner: 6)
  64. choseLocalAllBtn.tag = 10
  65. choseLocalAllBtn.addTarget(self, action: #selector(btnClick(sender:)), for: .touchUpInside)
  66. return choseLocalAllBtn
  67. }()
  68. lazy var choseLocalVideoBtn: UIButton = {
  69. let choseLocalVideoBtn = UIButton(frame: CGRect(x: choseLocalAllBtn.frame.maxX + (view.frame.width - choseBtnW * 3) / 4, y: choseLocalAllBtn.frame.minY, width: choseBtnW, height: choseBtnH))
  70. choseLocalVideoBtn.setTitleColor(UIColor.hexColor(hexadecimal: "#999999"), for: .normal)
  71. choseLocalVideoBtn.setTitleColor(PQBFConfig.shared.styleTitleColor, for: .selected)
  72. choseLocalVideoBtn.setTitle("视频", for: .normal)
  73. choseLocalVideoBtn.titleLabel?.font = UIFont.systemFont(ofSize: 17, weight: .medium)
  74. choseLocalVideoBtn.addCorner(corner: 6)
  75. choseLocalVideoBtn.tag = 11
  76. choseLocalVideoBtn.isSelected = true
  77. choseLocalVideoBtn.addTarget(self, action: #selector(btnClick(sender:)), for: .touchUpInside)
  78. return choseLocalVideoBtn
  79. }()
  80. lazy var choseLocalImageBtn: UIButton = {
  81. let choseLocalImageBtn = UIButton(frame: CGRect(x: choseLocalVideoBtn.frame.maxX + (view.frame.width - choseBtnW * 3) / 4, y: choseLocalAllBtn.frame.minY, width: choseBtnW, height: choseBtnH))
  82. choseLocalImageBtn.setTitleColor(UIColor.hexColor(hexadecimal: "#999999"), for: .normal)
  83. choseLocalImageBtn.setTitleColor(PQBFConfig.shared.styleTitleColor, for: .selected)
  84. choseLocalImageBtn.setTitle("照片", for: .normal)
  85. choseLocalImageBtn.titleLabel?.font = UIFont.systemFont(ofSize: 17, weight: .medium)
  86. choseLocalImageBtn.addCorner(corner: 6)
  87. choseLocalImageBtn.tag = 12
  88. choseLocalImageBtn.addTarget(self, action: #selector(btnClick(sender:)), for: .touchUpInside)
  89. return choseLocalImageBtn
  90. }()
  91. lazy var choseLineView: UIView = {
  92. let choseLineView = UIView(frame: CGRect(x: 0, y: 0, width: 25, height: 3))
  93. choseLineView.frame.origin.y = (navHeadImageView?.frame.maxY ?? 0) - 6
  94. choseLineView.center.x = choseLocalVideoBtn.center.x
  95. choseLineView.backgroundColor = UIColor.hexColor(hexadecimal: PQBFConfig.shared.styleColor.rawValue)
  96. return choseLineView
  97. }()
  98. // 顶部提示视图
  99. // lazy var materialHeadView: PQStuckPointMaterialHeadView = {
  100. // let materialHeadView: PQStuckPointMaterialHeadView = PQStuckPointMaterialHeadView(frame: CGRect(x: 0, y: navHeadImageView?.frame.maxY ?? cDevice_iPhoneNavBarAndStatusBarHei, width: view.frame.width, height: topImageH))
  101. // return materialHeadView
  102. // }()
  103. // 底部操作视图
  104. lazy var bottomRemindView: UIView = {
  105. let bottomRemindView = UIView(frame: CGRect(x: 0, y: view.frame.height - (bottomH + cSafeAreaHeight), width: view.frame.width, height: bottomH + cSafeAreaHeight))
  106. bottomRemindView.backgroundColor = PQBFConfig.shared.styleBackGroundColor
  107. return bottomRemindView
  108. }()
  109. // 确定按钮
  110. lazy var confirmBtn: UIButton = {
  111. let confirmBtn = UIButton(frame: CGRect(x: bottomRemindView.frame.width - cDefaultMargin * 9 - margin, y: margin / 2, width: cDefaultMargin * 9, height: bottomH - margin))
  112. confirmBtn.backgroundColor = PQBFConfig.shared.otherTintColor
  113. // confirmBtn.backgroundColor = UIColor.hexColor(hexadecimal: "#EE0051")
  114. confirmBtn.setTitle("确定", for: .normal)
  115. confirmBtn.setTitleColor(UIColor.hexColor(hexadecimal: "#999999"), for: .normal)
  116. confirmBtn.setTitleColor(UIColor.white, for: .selected)
  117. confirmBtn.titleLabel?.font = UIFont.systemFont(ofSize: 13, weight: .medium)
  118. confirmBtn.addCorner(corner: 3)
  119. confirmBtn.tag = 13
  120. confirmBtn.addTarget(self, action: #selector(btnClick(sender:)), for: .touchUpInside)
  121. return confirmBtn
  122. }()
  123. // 底部提示视图
  124. lazy var bottomRemindLab: UILabel = {
  125. let bottomRemindLab = UILabel(frame: CGRect(x: margin, y: 0, width: bottomRemindView.frame.width - margin * 3 - confirmBtn.frame.width, height: bottomH))
  126. bottomRemindLab.attributedText = NSAttributedString(string: "至少选择 1 个视频或 2 张照片")
  127. bottomRemindLab.textAlignment = .left
  128. bottomRemindLab.textColor = PQBFConfig.shared.styleTitleColor
  129. bottomRemindLab.font = UIFont.systemFont(ofSize: 14, weight: .medium)
  130. return bottomRemindLab
  131. }()
  132. /// 已选素材列表
  133. lazy var materialListView: BFSelectedMaterialListView = {
  134. let materialListView = BFSelectedMaterialListView(frame: CGRect(x: 0, y: cScreenHeigth, width: cScreenWidth, height: 88))
  135. materialListView.deletedMaterialHandle = { [weak self] materialData, isDissmiss in
  136. /// 处理已经选择的数据
  137. self?.dealWithSelectedMaterials(isDissmiss: isDissmiss, isChose: false, materialData: materialData)
  138. }
  139. materialListView.detailMaterialHandle = { [weak self] _, materialData in
  140. let detailVc: BFMaterialDetailController = BFMaterialDetailController()
  141. detailVc.materialDetailClickHandle = { [weak self] isMaterialSelected, materialData in
  142. if isMaterialSelected != materialData?.isSelected {
  143. self?.photoMaterialVc.updateMaterials(isSelected:!(isMaterialSelected ?? false), materialData: materialData)
  144. }
  145. }
  146. if !(materialData?.isSelected ?? false) {
  147. materialData?.selectedIndex = (self?.selectedDataCount ?? 0) + 1
  148. }
  149. detailVc.isStuckPoint = true
  150. detailVc.materialData = materialData
  151. self?.navigationController?.pushViewController(detailVc, animated: true)
  152. }
  153. return materialListView
  154. }()
  155. /// 图片加载视图
  156. lazy var photoMaterialVc: BFPhotosMaterialController = {
  157. let photoMaterialVc = BFPhotosMaterialController()
  158. photoMaterialVc.isShowMediaTag = false
  159. photoMaterialVc.imageDuration = 1.5
  160. addChild(photoMaterialVc)
  161. view.insertSubview(photoMaterialVc.view, belowSubview: bottomRemindView)
  162. photoMaterialVc.updateFrame(newFrame: CGRect(x: 0, y: (navHeadImageView?.frame.maxY ?? cDevice_iPhoneNavBarAndStatusBarHei) + margin / 2, width: view.frame.width, height: view.frame.height - ((navHeadImageView?.frame.maxY ?? cDevice_iPhoneNavBarAndStatusBarHei) + margin + bottomRemindView.frame.height)))
  163. photoMaterialVc.selectedMaterialHandle = { [weak self] currentMaterialData, selectedPhotoData, selectedTotalDuration, imageCount in
  164. self?.dealWithSelectedMaterial(materialData: currentMaterialData, selectedDatas: selectedPhotoData, totalDuration: selectedTotalDuration, imageCount: imageCount)
  165. /// 处理已经选择的数据
  166. self?.dealWithSelectedMaterials(isDissmiss: selectedPhotoData.count <= 0, isChose: true, materialData: currentMaterialData)
  167. }
  168. photoMaterialVc.detailMaterialHandle = { [weak self] _, currentMaterialData in
  169. let detailVc: BFMaterialDetailController = BFMaterialDetailController()
  170. detailVc.isStuckPoint = true
  171. detailVc.materialDetailClickHandle = { [weak self] isMaterialSelected, materialData in
  172. if isMaterialSelected != materialData?.isSelected {
  173. self?.photoMaterialVc.updateMaterials(isSelected:!(isMaterialSelected ?? false), materialData: materialData)
  174. }
  175. }
  176. if !(currentMaterialData?.isSelected ?? false) {
  177. currentMaterialData?.selectedIndex = (self?.selectedDataCount ?? 0) + 1
  178. }
  179. detailVc.materialData = currentMaterialData
  180. self?.navigationController?.pushViewController(detailVc, animated: true)
  181. }
  182. photoMaterialVc.emptyRefreshHandle = { [weak self] msgType in
  183. self?.btnClick(sender: msgType == .video ? self?.choseLocalImageBtn : (msgType == .image ? self?.choseLocalVideoBtn : self?.choseLocalAllBtn))
  184. }
  185. photoMaterialVc.scrollViewDidScroll = { [weak self] _ in
  186. // 更新frame
  187. // self?.updateMaterialHeadFrame(contentOffset: contentOffset)
  188. }
  189. return photoMaterialVc
  190. }()
  191. override public func viewDidLoad() {
  192. super.viewDidLoad()
  193. leftButton(image: UIImage.init(named: "upload_delete"), tintColor: PQBFConfig.shared.styleTitleColor)
  194. navHeadImageView?.addSubview(changeCollecBtn)
  195. navHeadImageView?.frame.size.height = cDevice_iPhoneNavBarAndStatusBarHei + margin * 2 + choseBtnH
  196. navHeadImageView?.addSubview(choseLocalAllBtn)
  197. navHeadImageView?.addSubview(choseLocalVideoBtn)
  198. navHeadImageView?.addSubview(choseLocalImageBtn)
  199. navHeadImageView?.addSubview(choseLineView)
  200. // view.insertSubview(materialHeadView, belowSubview: navHeadImageView!)
  201. view.addSubview(bottomRemindView)
  202. bottomRemindView.addSubview(confirmBtn)
  203. bottomRemindView.addSubview(bottomRemindLab)
  204. photoMaterialVc.msgType = .video
  205. view.bringSubviewToFront(navHeadImageView!)
  206. view.insertSubview(materialListView, belowSubview: bottomRemindView)
  207. // 卡点音乐素材选择曝光上报
  208. PQEventTrackViewModel.baseReportUpload(businessType: .bt_windowView, objectType: .ot_view_selectSyncedUpMaterial, pageSource: .sp_stuck_selectMaterial, extParams: nil, remindmsg: "卡点视频数据上报-(曝光上报:卡点视频素材选择页)")
  209. // 注册通知
  210. addNotification(self, selector: #selector(dismissVc), name: cFinishedPublishedNotiKey, object: nil)
  211. }
  212. /// 按钮点击事件
  213. /// - Parameter sender: <#sender description#>
  214. /// - Returns: <#description#>
  215. @objc func btnClick(sender: UIButton?) {
  216. switch sender?.tag {
  217. case 1: // 选择图库
  218. sender?.isSelected = !(sender?.isSelected ?? false)
  219. if sender?.isSelected ?? false {
  220. albumController.showCategoryView()
  221. } else {
  222. albumController.dismissCategoryView()
  223. }
  224. case 10, 11, 12: // 筛选全部图库
  225. choseLocalAllBtn.isSelected = sender?.tag == 10
  226. choseLocalVideoBtn.isSelected = sender?.tag == 11
  227. choseLocalImageBtn.isSelected = sender?.tag == 12
  228. if sender?.tag == 11 {
  229. photoMaterialVc.msgType = .video
  230. } else if sender?.tag == 12 {
  231. photoMaterialVc.msgType = .image
  232. } else {
  233. photoMaterialVc.msgType = .all
  234. }
  235. UIView.animate(withDuration: 0.3, delay: 0, options: .allowUserInteraction) { [weak self] in
  236. self?.choseLineView.center.x = sender?.center.x ?? 0
  237. } completion: { _ in
  238. }
  239. case 13:
  240. if confirmBtn.isSelected {
  241. // reCreateMusicData?.endTime = (reCreateMusicData?.startTime ?? 0) + (reCreateMusicData?.stuckPointCuttingTime(videoCount: selectedDataCount - selectedImageDataCount, imageCount: selectedImageDataCount, totalDuration: photoMaterialVc.selectedTotalDuration) ?? 0)
  242. if(reCreateMusicData != nil){
  243. let editerVC: PQStuckPointEditerController = PQStuckPointEditerController()
  244. editerVC.stuckPointMusicData = reCreateMusicData
  245. editerVC.selectedDataCount = selectedDataCount
  246. editerVC.selectedImageDataCount = selectedImageDataCount
  247. //mdf by ak 进入编辑界面的时候去掉图片的时长
  248. editerVC.selectedTotalDuration = photoMaterialVc.selectedTotalDuration - (Double(selectedImageDataCount) * 1.5)
  249. editerVC.selectedPhotoData = photoMaterialVc.selectedPhotoData
  250. editerVC.reCreateVideoData = reCreateVideoData
  251. editerVC.isReCreate = true
  252. navigationController?.pushViewController(editerVC, animated: true)
  253. }else{
  254. let stuckPointMusicVc = PQStuckPointMusicController()
  255. stuckPointMusicVc.selectedMusicData = reCreateMusicData
  256. stuckPointMusicVc.selectedDataCount = selectedDataCount
  257. stuckPointMusicVc.reCreateVideoData = reCreateVideoData
  258. stuckPointMusicVc.selectedImageDataCount = selectedImageDataCount
  259. stuckPointMusicVc.selectedTotalDuration = photoMaterialVc.selectedTotalDuration
  260. stuckPointMusicVc.selectedPhotoData = photoMaterialVc.selectedPhotoData
  261. navigationController?.pushViewController(stuckPointMusicVc, animated: true)
  262. }
  263. // 卡点视频素材确认按钮
  264. PQEventTrackViewModel.baseReportUpload(businessType: .bt_buttonClick, objectType: .ot_click_confirmMaterial, pageSource: .sp_stuck_selectMaterial, extParams: ["materialNumber": selectedDataCount], remindmsg: "卡点视频数据上报-(点击上报:卡点视频素材确认按钮)")
  265. }
  266. default:
  267. break
  268. }
  269. }
  270. public override func backBtnClick() {
  271. super.backBtnClick()
  272. if isPresent {
  273. postNotification(name: cFinishedPublishedNotiKey)
  274. }
  275. // 卡点视频返回按钮点击上报
  276. PQEventTrackViewModel.baseReportUpload(businessType: .bt_buttonClick, objectType: .ot_click_back, pageSource: .sp_stuck_selectMaterial, extParams: nil, remindmsg: "卡点视频数据上报-(点击上报:返回按钮)")
  277. }
  278. // 返回
  279. @objc func dismissVc() {
  280. DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.2) { [weak self] in
  281. if self?.isPresent ?? false {
  282. self?.dismiss(animated: true, completion: nil)
  283. }
  284. }
  285. }
  286. deinit {
  287. PQNotification.removeObserver(self)
  288. }
  289. /// 图库选择的回调
  290. /// - Parameter seletedData: <#seletedData description#>
  291. /// - Returns: <#description#>
  292. func albumSelectedHandle(seletedData: PHAsset?) {
  293. changeCollecBtn.isSelected = false
  294. if seletedData != nil {
  295. changeCollecBtn.setTitle(seletedData?.title ?? "全部", for: .normal)
  296. changeCollecBtn.imagePosition(at: PQButtonImageEdgeInsetsStyle.right, space: cDefaultMargin / 2)
  297. photoMaterialVc.assetCollection = seletedData?.assetCollection
  298. photoMaterialVc.msgType = photoMaterialVc.msgType
  299. }
  300. // photoMaterialVc.msgType = .video
  301. // choseLocalAllBtn.isSelected = false
  302. // choseLocalVideoBtn.isSelected = true
  303. // choseLocalImageBtn.isSelected = false
  304. }
  305. /// 点击选择的回调
  306. /// - Parameter materialData: <#materialData description#>
  307. /// - Returns: <#description#>
  308. func dealWithSelectedMaterial(materialData _: PHAsset?, selectedDatas: [PHAsset]?, totalDuration: Float64, imageCount: Int) {
  309. selectedDataCount = selectedDatas?.count ?? 0
  310. selectedImageDataCount = imageCount
  311. confirmBtn.isSelected = (selectedDataCount > 0 && (imageCount >= 2 || selectedDataCount > imageCount))
  312. if confirmBtn.isSelected {
  313. confirmBtn.backgroundColor = UIColor.hexColor(hexadecimal: PQBFConfig.shared.styleColor.rawValue)
  314. } else {
  315. confirmBtn.backgroundColor = PQBFConfig.shared.otherTintColor
  316. }
  317. if selectedDataCount <= 0 {
  318. bottomRemindLab.attributedText = NSAttributedString(string: "至少选择 1 个视频或 2 张照片")
  319. } else if selectedImageDataCount == 1, selectedDataCount == selectedImageDataCount {
  320. let att = NSMutableAttributedString(string: "至少选择 1 个视频或 2 张照片")
  321. bottomRemindLab.attributedText = att
  322. } else {
  323. let att = NSMutableAttributedString(string: "素材总时长 \(totalDuration.formatDurationToHMS())")
  324. att.setAttributes([.foregroundColor: UIColor.hexColor(hexadecimal: PQBFConfig.shared.styleColor.rawValue)], range: NSRange(location: 6, length: "\(totalDuration.formatDurationToHMS())".count))
  325. bottomRemindLab.attributedText = att
  326. }
  327. confirmBtn.setTitle(selectedDataCount > 0 ? "确定(\(selectedDataCount))" : "确定", for: .normal)
  328. }
  329. /// 处理已经选择的数据
  330. /// - Returns: <#description#>
  331. func dealWithSelectedMaterials(isDissmiss: Bool, isChose: Bool, materialData: PHAsset?) {
  332. // 添加当前素材
  333. if materialData != nil {
  334. if isChose {
  335. materialListView.addMaterialData(materialData: materialData!)
  336. } else {
  337. photoMaterialVc.deSeletedMaterialData(materialData: materialData)
  338. }
  339. }
  340. if isChose && !isDissmiss && materialListView.frame.minY > (bottomRemindView.frame.minY - 88) {
  341. UIView.animate(withDuration: 0.5, delay: 0, options: .allowUserInteraction) { [weak self] in
  342. self?.materialListView.frame = CGRect(x: 0, y: (self?.bottomRemindView.frame.minY ?? 0) - 88, width: cScreenWidth, height: 88)
  343. self?.photoMaterialVc.updateFrame(newFrame: CGRect(x: 0, y: self?.photoMaterialVc.view.frame.minY ?? 0, width: self?.photoMaterialVc.view.frame.width ?? 0, height: (self?.photoMaterialVc.view.frame.height ?? 0) - 88))
  344. } completion: { _ in
  345. }
  346. } else if isDissmiss && materialListView.frame.minY != cScreenHeigth {
  347. UIView.animate(withDuration: 0.5, delay: 0, options: .allowUserInteraction) { [weak self] in
  348. self?.materialListView.frame = CGRect(x: 0, y: cScreenHeigth, width: cScreenWidth, height: 88)
  349. self?.photoMaterialVc.updateFrame(newFrame: CGRect(x: 0, y: self?.photoMaterialVc.view.frame.minY ?? 0, width: self?.photoMaterialVc.view.frame.width ?? 0, height: (self?.photoMaterialVc.view.frame.height ?? 0) + 88))
  350. } completion: { _ in
  351. }
  352. }
  353. }
  354. }