replacing SwiftUIRefresh with refreshable

This commit is contained in:
andy 2022-04-21 15:02:44 +01:00
parent 137cf17c46
commit bbeae5b432
8 changed files with 61 additions and 84 deletions

View File

@ -9,7 +9,6 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
E906F7F42414019C004E1E31 /* NetworkPersister.swift in Sources */ = {isa = PBXBuildFile; fileRef = E906F7F32414019C004E1E31 /* NetworkPersister.swift */; }; E906F7F42414019C004E1E31 /* NetworkPersister.swift in Sources */ = {isa = PBXBuildFile; fileRef = E906F7F32414019C004E1E31 /* NetworkPersister.swift */; };
E906F7F724143AA7004E1E31 /* SwiftUICharts in Frameworks */ = {isa = PBXBuildFile; productRef = E906F7F624143AA7004E1E31 /* SwiftUICharts */; }; 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 */; }; E934AC99240DD0E4009869F4 /* AddTagSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = E934AC98240DD0E4009869F4 /* AddTagSheet.swift */; };
E971F8B9245462D500B543B6 /* Router.swift in Sources */ = {isa = PBXBuildFile; fileRef = E971F8B8245462D500B543B6 /* Router.swift */; }; E971F8B9245462D500B543B6 /* Router.swift in Sources */ = {isa = PBXBuildFile; fileRef = E971F8B8245462D500B543B6 /* Router.swift */; };
E97AF45623FC4E7800635494 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = E97AF45523FC4E7800635494 /* User.swift */; }; E97AF45623FC4E7800635494 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = E97AF45523FC4E7800635494 /* User.swift */; };
@ -62,6 +61,7 @@
/* End PBXContainerItemProxy section */ /* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
A146915A28118F940052999D /* Music Tools.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Music Tools.entitlements"; sourceTree = "<group>"; };
E906F7F32414019C004E1E31 /* NetworkPersister.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkPersister.swift; sourceTree = "<group>"; }; E906F7F32414019C004E1E31 /* NetworkPersister.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkPersister.swift; sourceTree = "<group>"; };
E934AC98240DD0E4009869F4 /* AddTagSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddTagSheet.swift; sourceTree = "<group>"; }; E934AC98240DD0E4009869F4 /* AddTagSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddTagSheet.swift; sourceTree = "<group>"; };
E971F8B8245462D500B543B6 /* Router.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Router.swift; sourceTree = "<group>"; }; E971F8B8245462D500B543B6 /* Router.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Router.swift; sourceTree = "<group>"; };
@ -105,7 +105,6 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
E92F94822401412100B6B721 /* SwiftUIRefresh in Frameworks */,
E97AF45923FC50EC00635494 /* SwiftyJSON in Frameworks */, E97AF45923FC50EC00635494 /* SwiftyJSON in Frameworks */,
E98254D923FB53780056D9D3 /* Alamofire in Frameworks */, E98254D923FB53780056D9D3 /* Alamofire in Frameworks */,
E97AF45E23FC83AF00635494 /* KeychainAccess in Frameworks */, E97AF45E23FC83AF00635494 /* KeychainAccess in Frameworks */,
@ -230,6 +229,7 @@
E9EA690923F9A5430012C3E8 /* Music Tools */ = { E9EA690923F9A5430012C3E8 /* Music Tools */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A146915A28118F940052999D /* Music Tools.entitlements */,
E98254C623FA25280056D9D3 /* Application */, E98254C623FA25280056D9D3 /* Application */,
E9EA691023F9A54A0012C3E8 /* Assets.xcassets */, E9EA691023F9A54A0012C3E8 /* Assets.xcassets */,
E9EA691823F9A54B0012C3E8 /* Info.plist */, E9EA691823F9A54B0012C3E8 /* Info.plist */,
@ -288,7 +288,6 @@
E98254D823FB53780056D9D3 /* Alamofire */, E98254D823FB53780056D9D3 /* Alamofire */,
E97AF45823FC50EC00635494 /* SwiftyJSON */, E97AF45823FC50EC00635494 /* SwiftyJSON */,
E97AF45D23FC83AF00635494 /* KeychainAccess */, E97AF45D23FC83AF00635494 /* KeychainAccess */,
E92F94812401412100B6B721 /* SwiftUIRefresh */,
E906F7F624143AA7004E1E31 /* SwiftUICharts */, E906F7F624143AA7004E1E31 /* SwiftUICharts */,
); );
productName = "Music Tools"; productName = "Music Tools";
@ -367,7 +366,6 @@
E98254D723FB53770056D9D3 /* XCRemoteSwiftPackageReference "alamofire" */, E98254D723FB53770056D9D3 /* XCRemoteSwiftPackageReference "alamofire" */,
E97AF45723FC50EC00635494 /* XCRemoteSwiftPackageReference "swiftyjson" */, E97AF45723FC50EC00635494 /* XCRemoteSwiftPackageReference "swiftyjson" */,
E97AF45C23FC83AF00635494 /* XCRemoteSwiftPackageReference "keychainaccess" */, E97AF45C23FC83AF00635494 /* XCRemoteSwiftPackageReference "keychainaccess" */,
E92F94802401412100B6B721 /* XCRemoteSwiftPackageReference "swiftuirefresh" */,
E906F7F524143AA7004E1E31 /* XCRemoteSwiftPackageReference "chartview" */, E906F7F524143AA7004E1E31 /* XCRemoteSwiftPackageReference "chartview" */,
); );
productRefGroup = E9EA690823F9A5430012C3E8 /* Products */; productRefGroup = E9EA690823F9A5430012C3E8 /* Products */;
@ -604,6 +602,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "Music Tools/Music Tools.entitlements";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "Music\\ Tools/Preview\\ Content"; DEVELOPMENT_ASSET_PATHS = "Music\\ Tools/Preview\\ Content";
DEVELOPMENT_TEAM = 8UZ2659FDY; DEVELOPMENT_TEAM = 8UZ2659FDY;
@ -615,6 +614,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = "xyz.sarsoo.Music-Tools"; PRODUCT_BUNDLE_IDENTIFIER = "xyz.sarsoo.Music-Tools";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = NO;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
}; };
@ -624,6 +624,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "Music Tools/Music Tools.entitlements";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "Music\\ Tools/Preview\\ Content"; DEVELOPMENT_ASSET_PATHS = "Music\\ Tools/Preview\\ Content";
DEVELOPMENT_TEAM = 8UZ2659FDY; DEVELOPMENT_TEAM = 8UZ2659FDY;
@ -635,6 +636,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = "xyz.sarsoo.Music-Tools"; PRODUCT_BUNDLE_IDENTIFIER = "xyz.sarsoo.Music-Tools";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = NO;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
}; };
@ -774,14 +776,6 @@
minimumVersion = 1.4.9; 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" */ = { E97AF45723FC50EC00635494 /* XCRemoteSwiftPackageReference "swiftyjson" */ = {
isa = XCRemoteSwiftPackageReference; isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/swiftyjson/swiftyjson"; repositoryURL = "https://github.com/swiftyjson/swiftyjson";
@ -814,11 +808,6 @@
package = E906F7F524143AA7004E1E31 /* XCRemoteSwiftPackageReference "chartview" */; package = E906F7F524143AA7004E1E31 /* XCRemoteSwiftPackageReference "chartview" */;
productName = SwiftUICharts; productName = SwiftUICharts;
}; };
E92F94812401412100B6B721 /* SwiftUIRefresh */ = {
isa = XCSwiftPackageProductDependency;
package = E92F94802401412100B6B721 /* XCRemoteSwiftPackageReference "swiftuirefresh" */;
productName = SwiftUIRefresh;
};
E97AF45823FC50EC00635494 /* SwiftyJSON */ = { E97AF45823FC50EC00635494 /* SwiftyJSON */ = {
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
package = E97AF45723FC50EC00635494 /* XCRemoteSwiftPackageReference "swiftyjson" */; package = E97AF45723FC50EC00635494 /* XCRemoteSwiftPackageReference "swiftyjson" */;

View File

@ -1,61 +1,41 @@
{ {
"object": { "pins" : [
"pins": [
{ {
"package": "Alamofire", "identity" : "alamofire",
"repositoryURL": "https://github.com/alamofire/alamofire.git", "kind" : "remoteSourceControl",
"state": { "location" : "https://github.com/alamofire/alamofire.git",
"branch": null, "state" : {
"revision": "0c8cb78d05b6d067ee331c05058ff4dedcb45ffa", "revision" : "0c8cb78d05b6d067ee331c05058ff4dedcb45ffa",
"version": "5.0.0" "version" : "5.0.0"
} }
}, },
{ {
"package": "SwiftUICharts", "identity" : "chartview",
"repositoryURL": "https://github.com/apppear/chartview", "kind" : "remoteSourceControl",
"state": { "location" : "https://github.com/apppear/chartview",
"branch": null, "state" : {
"revision": "04989ad159380290a74729dbce1d39d64b893ab2", "revision" : "04989ad159380290a74729dbce1d39d64b893ab2",
"version": "1.4.9" "version" : "1.4.9"
} }
}, },
{ {
"package": "KeychainAccess", "identity" : "keychainaccess",
"repositoryURL": "https://github.com/kishikawakatsumi/keychainaccess", "kind" : "remoteSourceControl",
"state": { "location" : "https://github.com/kishikawakatsumi/keychainaccess",
"branch": null, "state" : {
"revision": "b920ad7df3c73189dcdd4aa05c540849b2010dbf", "revision" : "b920ad7df3c73189dcdd4aa05c540849b2010dbf",
"version": "4.1.0" "version" : "4.1.0"
} }
}, },
{ {
"package": "Introspect", "identity" : "swiftyjson",
"repositoryURL": "https://github.com/siteline/SwiftUI-Introspect.git", "kind" : "remoteSourceControl",
"state": { "location" : "https://github.com/swiftyjson/swiftyjson",
"branch": null, "state" : {
"revision": "de5c32c15ae169cfcb27397ffb2734dcd0e1e6d5", "revision" : "2b6054efa051565954e1d2b9da831680026cd768",
"version": "0.1.0" "version" : "5.0.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"
} }
} }
] ],
}, "version" : 2
"version": 1
} }

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>

View File

@ -7,7 +7,6 @@
// //
import SwiftUI import SwiftUI
import SwiftUIRefresh
import Alamofire import Alamofire
import SwiftyJSON import SwiftyJSON

View File

@ -35,7 +35,8 @@ struct PlaylistList: View {
Text("No Playlists") Text("No Playlists")
} }
} }
.pullToRefresh(isShowing: self.$liveUser.isRefreshingPlaylists) { .refreshable
{
self.liveUser.refreshPlaylists() self.liveUser.refreshPlaylists()
} }
.navigationBarTitle(Text("Playlists 📻")) .navigationBarTitle(Text("Playlists 📻"))

View File

@ -7,7 +7,6 @@
// //
import SwiftUI import SwiftUI
import SwiftUIRefresh
import SwiftyJSON import SwiftyJSON
import SwiftUICharts import SwiftUICharts
@ -201,7 +200,7 @@ struct PlaylistView: View {
} }
.navigationBarTitle(Text(playlist.name), displayMode: .inline) .navigationBarTitle(Text(playlist.name), displayMode: .inline)
.pullToRefresh(isShowing: $isRefreshing) { .refreshable {
self.refreshPlaylist() self.refreshPlaylist()
} }
} }

View File

@ -35,7 +35,7 @@ struct TagList: View {
Text("No Tags") Text("No Tags")
} }
} }
.pullToRefresh(isShowing: self.$liveUser.isRefreshingTags) { .refreshable {
self.liveUser.refreshTags() self.liveUser.refreshTags()
} }
.navigationBarTitle(Text("Tags 🎷")) .navigationBarTitle(Text("Tags 🎷"))

View File

@ -7,7 +7,6 @@
// //
import SwiftUI import SwiftUI
import SwiftUIRefresh
import SwiftyJSON import SwiftyJSON
import SwiftUICharts import SwiftUICharts
@ -96,7 +95,7 @@ struct TagView: View {
}), }),
title: self.tag.name, title: self.tag.name,
legend: "Scrobbles", style: chartStyle, legend: "Scrobbles", style: chartStyle,
form: ChartForm.medium, form: CGSize(width: 250, height: 300),
cornerImage: Image(systemName: "music.note") cornerImage: Image(systemName: "music.note")
) )
.padding() .padding()
@ -110,7 +109,7 @@ struct TagView: View {
} }
} }
}.listStyle(GroupedListStyle()) }.listStyle(GroupedListStyle())
.pullToRefresh(isShowing: $isRefreshing) { .refreshable {
self.refreshTag() self.refreshTag()
} }
.navigationBarTitle(Text(tag.name)) .navigationBarTitle(Text(tag.name))