From bbeae5b4322283b241354cee4c69bc078034c038 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 21 Apr 2022 15:02:44 +0100 Subject: [PATCH] replacing SwiftUIRefresh with refreshable --- Music Tools.xcodeproj/project.pbxproj | 23 ++--- .../xcshareddata/swiftpm/Package.resolved | 96 ++++++++----------- Music Tools/Music Tools.entitlements | 10 ++ Music Tools/Views/AppSkeleton.swift | 1 - Music Tools/Views/Playlist/PlaylistList.swift | 5 +- Music Tools/Views/Playlist/PlaylistView.swift | 3 +- Music Tools/Views/Tag/TagList.swift | 2 +- Music Tools/Views/Tag/TagView.swift | 5 +- 8 files changed, 61 insertions(+), 84 deletions(-) create mode 100644 Music Tools/Music Tools.entitlements diff --git a/Music Tools.xcodeproj/project.pbxproj b/Music Tools.xcodeproj/project.pbxproj index c716158..dfc9c77 100644 --- a/Music Tools.xcodeproj/project.pbxproj +++ b/Music Tools.xcodeproj/project.pbxproj @@ -9,7 +9,6 @@ /* Begin PBXBuildFile section */ E906F7F42414019C004E1E31 /* NetworkPersister.swift in Sources */ = {isa = PBXBuildFile; fileRef = E906F7F32414019C004E1E31 /* NetworkPersister.swift */; }; E906F7F724143AA7004E1E31 /* SwiftUICharts in Frameworks */ = {isa = PBXBuildFile; productRef = E906F7F624143AA7004E1E31 /* SwiftUICharts */; }; - E92F94822401412100B6B721 /* SwiftUIRefresh in Frameworks */ = {isa = PBXBuildFile; productRef = E92F94812401412100B6B721 /* SwiftUIRefresh */; }; E934AC99240DD0E4009869F4 /* AddTagSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = E934AC98240DD0E4009869F4 /* AddTagSheet.swift */; }; E971F8B9245462D500B543B6 /* Router.swift in Sources */ = {isa = PBXBuildFile; fileRef = E971F8B8245462D500B543B6 /* Router.swift */; }; E97AF45623FC4E7800635494 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = E97AF45523FC4E7800635494 /* User.swift */; }; @@ -62,6 +61,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + A146915A28118F940052999D /* Music Tools.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Music Tools.entitlements"; sourceTree = ""; }; E906F7F32414019C004E1E31 /* NetworkPersister.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkPersister.swift; sourceTree = ""; }; E934AC98240DD0E4009869F4 /* AddTagSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddTagSheet.swift; sourceTree = ""; }; E971F8B8245462D500B543B6 /* Router.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Router.swift; sourceTree = ""; }; @@ -105,7 +105,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - E92F94822401412100B6B721 /* SwiftUIRefresh in Frameworks */, E97AF45923FC50EC00635494 /* SwiftyJSON in Frameworks */, E98254D923FB53780056D9D3 /* Alamofire in Frameworks */, E97AF45E23FC83AF00635494 /* KeychainAccess in Frameworks */, @@ -230,6 +229,7 @@ E9EA690923F9A5430012C3E8 /* Music Tools */ = { isa = PBXGroup; children = ( + A146915A28118F940052999D /* Music Tools.entitlements */, E98254C623FA25280056D9D3 /* Application */, E9EA691023F9A54A0012C3E8 /* Assets.xcassets */, E9EA691823F9A54B0012C3E8 /* Info.plist */, @@ -288,7 +288,6 @@ E98254D823FB53780056D9D3 /* Alamofire */, E97AF45823FC50EC00635494 /* SwiftyJSON */, E97AF45D23FC83AF00635494 /* KeychainAccess */, - E92F94812401412100B6B721 /* SwiftUIRefresh */, E906F7F624143AA7004E1E31 /* SwiftUICharts */, ); productName = "Music Tools"; @@ -367,7 +366,6 @@ E98254D723FB53770056D9D3 /* XCRemoteSwiftPackageReference "alamofire" */, E97AF45723FC50EC00635494 /* XCRemoteSwiftPackageReference "swiftyjson" */, E97AF45C23FC83AF00635494 /* XCRemoteSwiftPackageReference "keychainaccess" */, - E92F94802401412100B6B721 /* XCRemoteSwiftPackageReference "swiftuirefresh" */, E906F7F524143AA7004E1E31 /* XCRemoteSwiftPackageReference "chartview" */, ); productRefGroup = E9EA690823F9A5430012C3E8 /* Products */; @@ -604,6 +602,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = "Music Tools/Music Tools.entitlements"; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_ASSET_PATHS = "Music\\ Tools/Preview\\ Content"; DEVELOPMENT_TEAM = 8UZ2659FDY; @@ -615,6 +614,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = "xyz.sarsoo.Music-Tools"; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTS_MACCATALYST = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -624,6 +624,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = "Music Tools/Music Tools.entitlements"; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_ASSET_PATHS = "Music\\ Tools/Preview\\ Content"; DEVELOPMENT_TEAM = 8UZ2659FDY; @@ -635,6 +636,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = "xyz.sarsoo.Music-Tools"; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTS_MACCATALYST = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -774,14 +776,6 @@ minimumVersion = 1.4.9; }; }; - E92F94802401412100B6B721 /* XCRemoteSwiftPackageReference "swiftuirefresh" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/siteline/swiftuirefresh"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 0.0.2; - }; - }; E97AF45723FC50EC00635494 /* XCRemoteSwiftPackageReference "swiftyjson" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/swiftyjson/swiftyjson"; @@ -814,11 +808,6 @@ package = E906F7F524143AA7004E1E31 /* XCRemoteSwiftPackageReference "chartview" */; productName = SwiftUICharts; }; - E92F94812401412100B6B721 /* SwiftUIRefresh */ = { - isa = XCSwiftPackageProductDependency; - package = E92F94802401412100B6B721 /* XCRemoteSwiftPackageReference "swiftuirefresh" */; - productName = SwiftUIRefresh; - }; E97AF45823FC50EC00635494 /* SwiftyJSON */ = { isa = XCSwiftPackageProductDependency; package = E97AF45723FC50EC00635494 /* XCRemoteSwiftPackageReference "swiftyjson" */; diff --git a/Music Tools.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Music Tools.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 1b9aa59..5361dfc 100644 --- a/Music Tools.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Music Tools.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,61 +1,41 @@ { - "object": { - "pins": [ - { - "package": "Alamofire", - "repositoryURL": "https://github.com/alamofire/alamofire.git", - "state": { - "branch": null, - "revision": "0c8cb78d05b6d067ee331c05058ff4dedcb45ffa", - "version": "5.0.0" - } - }, - { - "package": "SwiftUICharts", - "repositoryURL": "https://github.com/apppear/chartview", - "state": { - "branch": null, - "revision": "04989ad159380290a74729dbce1d39d64b893ab2", - "version": "1.4.9" - } - }, - { - "package": "KeychainAccess", - "repositoryURL": "https://github.com/kishikawakatsumi/keychainaccess", - "state": { - "branch": null, - "revision": "b920ad7df3c73189dcdd4aa05c540849b2010dbf", - "version": "4.1.0" - } - }, - { - "package": "Introspect", - "repositoryURL": "https://github.com/siteline/SwiftUI-Introspect.git", - "state": { - "branch": null, - "revision": "de5c32c15ae169cfcb27397ffb2734dcd0e1e6d5", - "version": "0.1.0" - } - }, - { - "package": "SwiftUIRefresh", - "repositoryURL": "https://github.com/siteline/swiftuirefresh", - "state": { - "branch": null, - "revision": "6939ec13efa866eb9f556f5de7f0e06f5d7f2761", - "version": "0.0.2" - } - }, - { - "package": "SwiftyJSON", - "repositoryURL": "https://github.com/swiftyjson/swiftyjson", - "state": { - "branch": null, - "revision": "2b6054efa051565954e1d2b9da831680026cd768", - "version": "5.0.0" - } + "pins" : [ + { + "identity" : "alamofire", + "kind" : "remoteSourceControl", + "location" : "https://github.com/alamofire/alamofire.git", + "state" : { + "revision" : "0c8cb78d05b6d067ee331c05058ff4dedcb45ffa", + "version" : "5.0.0" } - ] - }, - "version": 1 + }, + { + "identity" : "chartview", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apppear/chartview", + "state" : { + "revision" : "04989ad159380290a74729dbce1d39d64b893ab2", + "version" : "1.4.9" + } + }, + { + "identity" : "keychainaccess", + "kind" : "remoteSourceControl", + "location" : "https://github.com/kishikawakatsumi/keychainaccess", + "state" : { + "revision" : "b920ad7df3c73189dcdd4aa05c540849b2010dbf", + "version" : "4.1.0" + } + }, + { + "identity" : "swiftyjson", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swiftyjson/swiftyjson", + "state" : { + "revision" : "2b6054efa051565954e1d2b9da831680026cd768", + "version" : "5.0.0" + } + } + ], + "version" : 2 } diff --git a/Music Tools/Music Tools.entitlements b/Music Tools/Music Tools.entitlements new file mode 100644 index 0000000..ee95ab7 --- /dev/null +++ b/Music Tools/Music Tools.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + + diff --git a/Music Tools/Views/AppSkeleton.swift b/Music Tools/Views/AppSkeleton.swift index 1223162..dba150b 100644 --- a/Music Tools/Views/AppSkeleton.swift +++ b/Music Tools/Views/AppSkeleton.swift @@ -7,7 +7,6 @@ // import SwiftUI -import SwiftUIRefresh import Alamofire import SwiftyJSON diff --git a/Music Tools/Views/Playlist/PlaylistList.swift b/Music Tools/Views/Playlist/PlaylistList.swift index ccedb57..f1ae5c9 100644 --- a/Music Tools/Views/Playlist/PlaylistList.swift +++ b/Music Tools/Views/Playlist/PlaylistList.swift @@ -26,7 +26,7 @@ struct PlaylistList: View { let api = PlaylistApi.deletePlaylist(name: self.liveUser.playlists[index].name) RequestBuilder.buildRequest(apiRequest: api).responseJSON{ response in - } + } } self.liveUser.playlists.remove(atOffsets: indexSet) @@ -35,7 +35,8 @@ struct PlaylistList: View { Text("No Playlists") } } - .pullToRefresh(isShowing: self.$liveUser.isRefreshingPlaylists) { + .refreshable + { self.liveUser.refreshPlaylists() } .navigationBarTitle(Text("Playlists 📻")) diff --git a/Music Tools/Views/Playlist/PlaylistView.swift b/Music Tools/Views/Playlist/PlaylistView.swift index 29b3e2d..c03f0f7 100644 --- a/Music Tools/Views/Playlist/PlaylistView.swift +++ b/Music Tools/Views/Playlist/PlaylistView.swift @@ -7,7 +7,6 @@ // import SwiftUI -import SwiftUIRefresh import SwiftyJSON import SwiftUICharts @@ -201,7 +200,7 @@ struct PlaylistView: View { } .navigationBarTitle(Text(playlist.name), displayMode: .inline) - .pullToRefresh(isShowing: $isRefreshing) { + .refreshable { self.refreshPlaylist() } } diff --git a/Music Tools/Views/Tag/TagList.swift b/Music Tools/Views/Tag/TagList.swift index 969e719..1e4f788 100644 --- a/Music Tools/Views/Tag/TagList.swift +++ b/Music Tools/Views/Tag/TagList.swift @@ -35,7 +35,7 @@ struct TagList: View { Text("No Tags") } } - .pullToRefresh(isShowing: self.$liveUser.isRefreshingTags) { + .refreshable { self.liveUser.refreshTags() } .navigationBarTitle(Text("Tags 🎷")) diff --git a/Music Tools/Views/Tag/TagView.swift b/Music Tools/Views/Tag/TagView.swift index ee8c5c8..16969d0 100644 --- a/Music Tools/Views/Tag/TagView.swift +++ b/Music Tools/Views/Tag/TagView.swift @@ -7,7 +7,6 @@ // import SwiftUI -import SwiftUIRefresh import SwiftyJSON import SwiftUICharts @@ -96,7 +95,7 @@ struct TagView: View { }), title: self.tag.name, legend: "Scrobbles", style: chartStyle, - form: ChartForm.medium, + form: CGSize(width: 250, height: 300), cornerImage: Image(systemName: "music.note") ) .padding() @@ -110,7 +109,7 @@ struct TagView: View { } } }.listStyle(GroupedListStyle()) - .pullToRefresh(isShowing: $isRefreshing) { + .refreshable { self.refreshTag() } .navigationBarTitle(Text(tag.name))