diff --git a/relax.offline.mp3.music.xcodeproj/project.pbxproj b/relax.offline.mp3.music.xcodeproj/project.pbxproj index 5b0272c..7b63f34 100644 --- a/relax.offline.mp3.music.xcodeproj/project.pbxproj +++ b/relax.offline.mp3.music.xcodeproj/project.pbxproj @@ -1879,7 +1879,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1.1.7.1; + CURRENT_PROJECT_VERSION = 1.1.8.1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = RAQJ4FNZUH; @@ -1900,7 +1900,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.1.7; + MARKETING_VERSION = 1.1.8; PRODUCT_BUNDLE_IDENTIFIER = relax.offline.mp3.music; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1925,7 +1925,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1.1.7.1; + CURRENT_PROJECT_VERSION = 1.1.8.1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = RAQJ4FNZUH; @@ -1946,7 +1946,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.1.7; + MARKETING_VERSION = 1.1.8; PRODUCT_BUNDLE_IDENTIFIER = relax.offline.mp3.music; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/relax.offline.mp3.music.xcworkspace/xcuserdata/zhou.xcuserdatad/UserInterfaceState.xcuserstate b/relax.offline.mp3.music.xcworkspace/xcuserdata/zhou.xcuserdatad/UserInterfaceState.xcuserstate index 9be50ce..5d85101 100644 Binary files a/relax.offline.mp3.music.xcworkspace/xcuserdata/zhou.xcuserdatad/UserInterfaceState.xcuserstate and b/relax.offline.mp3.music.xcworkspace/xcuserdata/zhou.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/relax.offline.mp3.music/MP/MPPositive/Views/Base/MPPositive_MoreOperationDownLoadTableViewCell.swift b/relax.offline.mp3.music/MP/MPPositive/Views/Base/MPPositive_MoreOperationDownLoadTableViewCell.swift index 99b9621..5f71190 100644 --- a/relax.offline.mp3.music/MP/MPPositive/Views/Base/MPPositive_MoreOperationDownLoadTableViewCell.swift +++ b/relax.offline.mp3.music/MP/MPPositive/Views/Base/MPPositive_MoreOperationDownLoadTableViewCell.swift @@ -48,13 +48,16 @@ class MPPositive_MoreOperationDownLoadTableViewCell: UITableViewCell { MP_DownloadManager.shared.loadQueue.async { [weak self] in guard let self = self else {return} - MP_DownloadManager.shared.isDownloadedFileDocuments(videoId) { statu in + MP_DownloadManager.shared.isDownloadedFileDocuments(videoId) {[weak self] statu in + guard let self = self else {return} if statu == false { //未下载,判断是否加入了下载队列 if MP_DownloadManager.shared.isTasksQueue(for: videoId) { //加入下载队列,确定是否活跃下载队列中 if MP_DownloadManager.shared.isActiveTask(for: videoId) { DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} self.loadBtn.state = .downloading self.titleLabel.text = "Downloading" } @@ -62,6 +65,8 @@ class MPPositive_MoreOperationDownLoadTableViewCell: UITableViewCell { if let progress = MP_DownloadManager.shared.getProgress(for: videoId) { //下载中 DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} self.loadBtn.stopDownloadButton.progress = progress } } diff --git a/relax.offline.mp3.music/MP/MPPositive/Views/Home/MPPositive_ArtistShowSongTableViewCell.swift b/relax.offline.mp3.music/MP/MPPositive/Views/Home/MPPositive_ArtistShowSongTableViewCell.swift index 0f1ebfc..e243db9 100644 --- a/relax.offline.mp3.music/MP/MPPositive/Views/Home/MPPositive_ArtistShowSongTableViewCell.swift +++ b/relax.offline.mp3.music/MP/MPPositive/Views/Home/MPPositive_ArtistShowSongTableViewCell.swift @@ -154,6 +154,8 @@ class MPPositive_ArtistShowSongTableViewCell: UITableViewCell, PKDownloadButtonD func setProgress(_ videoId:String) { guard videoId.isEmpty == false, videoId == itemView.browseItem.videoId else { DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} //未加入下载队列 self.loadBtn.state = .startDownload } @@ -163,25 +165,32 @@ class MPPositive_ArtistShowSongTableViewCell: UITableViewCell, PKDownloadButtonD [weak self] in guard let self = self else {return} //判断是否下载完成 - MP_DownloadManager.shared.isDownloadedFileDocuments(videoId) {statu in + MP_DownloadManager.shared.isDownloadedFileDocuments(videoId) {[weak self] statu in + guard let self = self else {return} if statu == false { //未下载,判断是否加入了下载队列 if MP_DownloadManager.shared.isTasksQueue(for: videoId) { //加入下载队列,确定是否活跃下中 if MP_DownloadManager.shared.isActiveTask(for: videoId) { DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} self.loadBtn.state = .downloading } //活跃中,获取下载值 if let progress = MP_DownloadManager.shared.getProgress(for: videoId) { //下载中 DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} self.loadBtn.stopDownloadButton.progress = progress } } }else { //处于队列中,还未开始下载 DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} //未加入下载队列 self.loadBtn.state = .pending } @@ -189,12 +198,16 @@ class MPPositive_ArtistShowSongTableViewCell: UITableViewCell, PKDownloadButtonD }else { //未加入下载队列 DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} //未加入下载队列 self.loadBtn.state = .startDownload } } }else { DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} //已经完成下载 self.loadBtn.state = .downloaded } diff --git a/relax.offline.mp3.music/MP/MPPositive/Views/Home/MPPositive_ArtistShowTypeView.swift b/relax.offline.mp3.music/MP/MPPositive/Views/Home/MPPositive_ArtistShowTypeView.swift index 696da36..acb4a31 100644 --- a/relax.offline.mp3.music/MP/MPPositive/Views/Home/MPPositive_ArtistShowTypeView.swift +++ b/relax.offline.mp3.music/MP/MPPositive/Views/Home/MPPositive_ArtistShowTypeView.swift @@ -85,7 +85,11 @@ class MPPositive_ArtistShowTypeView: UIView, JXPagingViewListViewDelegate, UIVie //上拉刷新 @objc private func footerRefresh() { guard sectionList.continuation != nil, sectionList.itct != nil else { - tableView.mj_footer?.endRefreshingWithNoMoreData() + DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} + tableView.mj_footer?.endRefreshingWithNoMoreData() + } return } sectionList.requestArtistContinuation() diff --git a/relax.offline.mp3.music/MP/MPPositive/Views/Home/MPPositive_HomeSingleCollectionViewCell.swift b/relax.offline.mp3.music/MP/MPPositive/Views/Home/MPPositive_HomeSingleCollectionViewCell.swift index 7d91971..a310598 100644 --- a/relax.offline.mp3.music/MP/MPPositive/Views/Home/MPPositive_HomeSingleCollectionViewCell.swift +++ b/relax.offline.mp3.music/MP/MPPositive/Views/Home/MPPositive_HomeSingleCollectionViewCell.swift @@ -157,6 +157,8 @@ class MPPositive_HomeSingleCollectionViewCell: UICollectionViewCell, PKDownloadB func setProgress(_ videoId:String) { guard videoId.isEmpty == false, videoId == itemViewModel?.browseItem.videoId else { DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} //未加入下载队列 self.dowloadBtn.state = .startDownload } @@ -166,25 +168,32 @@ class MPPositive_HomeSingleCollectionViewCell: UICollectionViewCell, PKDownloadB [weak self] in guard let self = self else {return} //判断是否下载完成 - MP_DownloadManager.shared.isDownloadedFileDocuments(videoId) { statu in + MP_DownloadManager.shared.isDownloadedFileDocuments(videoId) {[weak self] statu in + guard let self = self else {return} if statu == false { //未下载,判断是否加入了下载队列 if MP_DownloadManager.shared.isTasksQueue(for: videoId) { //加入下载队列,确定是否活跃下中 if MP_DownloadManager.shared.isActiveTask(for: videoId) { DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} self.dowloadBtn.state = .downloading } //活跃中,获取下载值 if let progress = MP_DownloadManager.shared.getProgress(for: videoId) { //下载中 DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} self.dowloadBtn.stopDownloadButton.progress = progress } } }else { //处于队列中,还未开始下载 DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} //未加入下载队列 self.dowloadBtn.state = .pending } @@ -192,12 +201,16 @@ class MPPositive_HomeSingleCollectionViewCell: UICollectionViewCell, PKDownloadB }else { //未加入下载队列 DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} //未加入下载队列 self.dowloadBtn.state = .startDownload } } }else { DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} //已经完成下载 self.dowloadBtn.state = .downloaded } diff --git a/relax.offline.mp3.music/MP/MPPositive/Views/Home/MPPositive_MusicItemShowTableViewCell.swift b/relax.offline.mp3.music/MP/MPPositive/Views/Home/MPPositive_MusicItemShowTableViewCell.swift index 0e8df2c..3738da4 100644 --- a/relax.offline.mp3.music/MP/MPPositive/Views/Home/MPPositive_MusicItemShowTableViewCell.swift +++ b/relax.offline.mp3.music/MP/MPPositive/Views/Home/MPPositive_MusicItemShowTableViewCell.swift @@ -89,6 +89,8 @@ class MPPositive_MusicItemShowTableViewCell: UITableViewCell, PKDownloadButtonDe func setProgress(_ videoId:String) { guard videoId.isEmpty == false, videoId == itemView?.browseItem.videoId else { DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} //未加入下载队列 self.loadBtn.state = .startDownload } @@ -98,25 +100,32 @@ class MPPositive_MusicItemShowTableViewCell: UITableViewCell, PKDownloadButtonDe [weak self] in guard let self = self else {return} //判断是否下载完成 - MP_DownloadManager.shared.isDownloadedFileDocuments(videoId) { statu in + MP_DownloadManager.shared.isDownloadedFileDocuments(videoId) {[weak self] statu in + guard let self = self else {return} if statu == false { //未下载,判断是否加入了下载队列 if MP_DownloadManager.shared.isTasksQueue(for: videoId) { //加入下载队列,确定是否活跃下中 if MP_DownloadManager.shared.isActiveTask(for: videoId) { DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} self.loadBtn.state = .downloading } //活跃中,获取下载值 if let progress = MP_DownloadManager.shared.getProgress(for: videoId) { //下载中 DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} self.loadBtn.stopDownloadButton.progress = progress } } }else { //处于队列中,还未开始下载 DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} //未加入下载队列 self.loadBtn.state = .pending } @@ -124,12 +133,16 @@ class MPPositive_MusicItemShowTableViewCell: UITableViewCell, PKDownloadButtonDe }else { //未加入下载队列 DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} //未加入下载队列 self.loadBtn.state = .startDownload } } }else { DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} //已经完成下载 self.loadBtn.state = .downloaded } diff --git a/relax.offline.mp3.music/MP/MPPositive/Views/Player/MPPositive_PlayerCoverView.swift b/relax.offline.mp3.music/MP/MPPositive/Views/Player/MPPositive_PlayerCoverView.swift index 60996f1..7daf306 100644 --- a/relax.offline.mp3.music/MP/MPPositive/Views/Player/MPPositive_PlayerCoverView.swift +++ b/relax.offline.mp3.music/MP/MPPositive/Views/Player/MPPositive_PlayerCoverView.swift @@ -185,25 +185,32 @@ class MPPositive_PlayerCoverView: UIView, PKDownloadButtonDelegate { MP_DownloadManager.shared.loadQueue.async { [weak self] in guard let self = self else {return} - MP_DownloadManager.shared.isDownloadedFileDocuments(videoId) { statu in + MP_DownloadManager.shared.isDownloadedFileDocuments(videoId) {[weak self] statu in + guard let self = self else {return} if statu == false { //未下载,判断是否加入了下载队列 if MP_DownloadManager.shared.isTasksQueue(for: videoId) { //加入下载队列,确定是否活跃下载队列中 if MP_DownloadManager.shared.isActiveTask(for: videoId) { DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} self.downloadButton.state = .downloading } //活跃中,获取下载值 if let progress = MP_DownloadManager.shared.getProgress(for: videoId) { //下载中 DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} self.downloadButton.stopDownloadButton.progress = progress } } }else { //处于队列中,还未开始下载 DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} //未加入下载队列 self.downloadButton.state = .pending } @@ -211,6 +218,8 @@ class MPPositive_PlayerCoverView: UIView, PKDownloadButtonDelegate { }else { //未加入下载队列 DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} //未加入下载队列 self.downloadButton.state = .startDownload } @@ -218,6 +227,8 @@ class MPPositive_PlayerCoverView: UIView, PKDownloadButtonDelegate { }else { //已经完成下载 DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} //已经完成下载 self.downloadButton.state = .downloaded } diff --git a/relax.offline.mp3.music/MP/MPPositive/Views/Search/MPPositive_SearchResultShowTableViewCell.swift b/relax.offline.mp3.music/MP/MPPositive/Views/Search/MPPositive_SearchResultShowTableViewCell.swift index df56ecc..21917c5 100644 --- a/relax.offline.mp3.music/MP/MPPositive/Views/Search/MPPositive_SearchResultShowTableViewCell.swift +++ b/relax.offline.mp3.music/MP/MPPositive/Views/Search/MPPositive_SearchResultShowTableViewCell.swift @@ -140,6 +140,8 @@ class MPPositive_SearchResultShowTableViewCell: UITableViewCell, PKDownloadButto func setProgress(_ videoId:String) { guard videoId.isEmpty == false, (videoId == itemView?.item?.videoId || videoId == songViewModel?.collectionSong.videoId || videoId == loadViewModel?.loadItem.videoId || videoId == videoModel?.videoId) else { DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} //未加入下载队列 self.loadBtn.state = .startDownload } @@ -149,37 +151,48 @@ class MPPositive_SearchResultShowTableViewCell: UITableViewCell, PKDownloadButto [weak self] in guard let self = self else {return} //判断是否下载完成 - MP_DownloadManager.shared.isDownloadedFileDocuments(videoId) { statu in + MP_DownloadManager.shared.isDownloadedFileDocuments(videoId) {[weak self] statu in + guard let self = self else {return} if statu == false { //未下载,判断是否加入了下载队列 if MP_DownloadManager.shared.isTasksQueue(for: videoId) { //加入下载队列,确定是否活跃下中 if MP_DownloadManager.shared.isActiveTask(for: videoId) { DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} self.loadBtn.state = .downloading } //活跃中,获取下载值 if let progress = MP_DownloadManager.shared.getProgress(for: videoId) { //下载中 DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} self.loadBtn.stopDownloadButton.progress = progress } } }else { //处于队列中,还未开始下载 DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} //未加入下载队列 self.loadBtn.state = .pending } } }else { DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} //未加入下载队列 self.loadBtn.state = .startDownload } } }else { DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} //已经完成下载 self.loadBtn.state = .downloaded } diff --git a/relax.offline.mp3.music/MP/MPPositive/Views/Search/MPPositive_SearchResultTypeShowView.swift b/relax.offline.mp3.music/MP/MPPositive/Views/Search/MPPositive_SearchResultTypeShowView.swift index 35e91e7..301c64b 100644 --- a/relax.offline.mp3.music/MP/MPPositive/Views/Search/MPPositive_SearchResultTypeShowView.swift +++ b/relax.offline.mp3.music/MP/MPPositive/Views/Search/MPPositive_SearchResultTypeShowView.swift @@ -95,7 +95,11 @@ class MPPositive_SearchResultTypeShowView: MPPositive_BaseShowView, JXSegmentedL //上拉刷新 @objc private func footerRefresh() { guard sectionList.continuation != nil, sectionList.itct != nil else { - tableView.mj_footer?.endRefreshingWithNoMoreData() + DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} + tableView.mj_footer?.endRefreshingWithNoMoreData() + } return } sectionList.requestSearchContinuation()