diff --git a/README.md b/README.md
index ac000ca..46fe452 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# iAppStore
-## 简介
+## 1. 项目介绍
iAppStore 是一款使用 SwiftUI 打造的苹果商店工具类 App。
@@ -9,22 +9,44 @@ iAppStore 是一款使用 SwiftUI 打造的苹果商店工具类 App。
- 3、支持苹果所有国家和地区的商店,无需切换 Apple Id,即可查看!
-> 本项目的背景,可以通过链接了解:[用 SwiftUI 实现一个开源的 App Store - 掘金](https://juejin.cn/post/7051512478630412301)
+> 本项目的发起原由:[用 SwiftUI 实现一个开源的 App Store - 掘金](https://juejin.cn/post/7051512478630412301)
-## 编译
+## 2. 安装说明
-- 支持 iOS 14 以上
-- 支持 macOS 11 以上
+### 2.1 iOS / iPadOS / Mac Apple Silicon
+- iOS 14.0+
+- iPadOS 14.0+
+- macOS 11.0+(Mac Apple Silicon M1/M2+)
-**运行方法:**
-打开项目即可编译,无需安装其它依赖库。
+
+TestFlight 下载地址:[https://testflight.apple.com/join/XXEQdVKN](https://testflight.apple.com/join/XXEQdVKN)
+
+> 注:
+> 1. TestFlight 名额有限,先下先得!
+> 2. 如无名额,iOS 和 iPadOS 需要自行编译安装。
+
+
+### 2.2 macSO 安装包下载
+
+- macOS 11.0+
+- Mac Apple Silicon M1/M2+
+- Mac Intel x86_64
+
+- Mac 下载:[Releases](https://github.com/37iOS/iAppStore-SwiftUI/releases)
+
+
+### 2.3 Xcode 构建
+
+- 构建依赖:Xcode14+
+
+下载项目后,双击 `iAppStore.xcodeproj` 打开项目即可编译,无需安装其它依赖库。
> 为了尽量更多的朋友入门 SwiftUI 学习,本项目未使用第三方框架,所以有一些功能实现简单,仅供参考。
> 另外,部分注释代码没有删除,是一些可能有价值的参考代码。
-## 效果示例
+## 3. 效果示例
**iOS**
@@ -39,7 +61,7 @@ iAppStore 是一款使用 SwiftUI 打造的苹果商店工具类 App。
-### TODO
+## 4. TODO
1. [x] 请求失败导致页面空白的处理(2022-02-02)
2. [] 数据请求可以按分页请求加载
@@ -49,7 +71,7 @@ iAppStore 是一款使用 SwiftUI 打造的苹果商店工具类 App。
6. [x] 应用订阅状态持久化(2023-02-13)
7. [] 多语言的支持(英文)
-### FAQ
+## 5. FAQ
* [New Issue](https://github.com/37iOS/iAppStore-SwiftUI/issues)
diff --git a/iAppStore.xcodeproj/project.pbxproj b/iAppStore.xcodeproj/project.pbxproj
index 8331322..001e492 100644
--- a/iAppStore.xcodeproj/project.pbxproj
+++ b/iAppStore.xcodeproj/project.pbxproj
@@ -11,6 +11,8 @@
6C51177527A2755100D5E21D /* NetworkManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C51177327A2755000D5E21D /* NetworkManager.swift */; };
6C51177627A2755100D5E21D /* NetworkMonitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C51177427A2755100D5E21D /* NetworkMonitor.swift */; };
6C9A423E27A637E60074FD09 /* LoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C9A423D27A637E60074FD09 /* LoadingView.swift */; };
+ 6D0809DC29FB576100D12E21 /* AppleServicesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D0809DB29FB576100D12E21 /* AppleServicesView.swift */; };
+ 6D0809DE29FB5FA500D12E21 /* SafariView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D0809DD29FB5FA500D12E21 /* SafariView.swift */; };
6D26AAC2278420CB003F82BF /* AboutAppView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D26AAC1278420CB003F82BF /* AboutAppView.swift */; };
6D490E542782F35F00B5DD80 /* Strings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D490E532782F35F00B5DD80 /* Strings.swift */; };
6D490E56278328E400B5DD80 /* SubscriptionAddView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D490E55278328E400B5DD80 /* SubscriptionAddView.swift */; };
@@ -67,6 +69,8 @@
6C51177327A2755000D5E21D /* NetworkManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkManager.swift; sourceTree = ""; };
6C51177427A2755100D5E21D /* NetworkMonitor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkMonitor.swift; sourceTree = ""; };
6C9A423D27A637E60074FD09 /* LoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingView.swift; sourceTree = ""; };
+ 6D0809DB29FB576100D12E21 /* AppleServicesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleServicesView.swift; sourceTree = ""; };
+ 6D0809DD29FB5FA500D12E21 /* SafariView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariView.swift; sourceTree = ""; };
6D26AAC1278420CB003F82BF /* AboutAppView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutAppView.swift; sourceTree = ""; };
6D490E532782F35F00B5DD80 /* Strings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Strings.swift; sourceTree = ""; };
6D490E55278328E400B5DD80 /* SubscriptionAddView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionAddView.swift; sourceTree = ""; };
@@ -186,6 +190,7 @@
children = (
6D738E2D2779736B00A4A76E /* SettingHome.swift */,
6D26AAC1278420CB003F82BF /* AboutAppView.swift */,
+ 6D0809DB29FB576100D12E21 /* AppleServicesView.swift */,
);
path = setting;
sourceTree = "";
@@ -215,6 +220,7 @@
children = (
6DB3B796277EEC7100E8626F /* ImageLoader.swift */,
6C9A423D27A637E60074FD09 /* LoadingView.swift */,
+ 6D0809DD29FB5FA500D12E21 /* SafariView.swift */,
);
path = UI;
sourceTree = "";
@@ -463,6 +469,7 @@
6C51177627A2755100D5E21D /* NetworkMonitor.swift in Sources */,
6D738E2E2779736B00A4A76E /* SettingHome.swift in Sources */,
6D738E2A2779734700A4A76E /* SearchHome.swift in Sources */,
+ 6D0809DC29FB576100D12E21 /* AppleServicesView.swift in Sources */,
6DB3B791277D757400E8626F /* AppRank.swift in Sources */,
6D738E282779733400A4A76E /* RankHome.swift in Sources */,
6DB3B70027799F6200E8626F /* AppDetailView.swift in Sources */,
@@ -480,6 +487,7 @@
6D605A15278B15850001C69F /* AppContextMenu.swift in Sources */,
6DB3B782277D6CE700E8626F /* Constants.swift in Sources */,
6D490E56278328E400B5DD80 /* SubscriptionAddView.swift in Sources */,
+ 6D0809DE29FB5FA500D12E21 /* SafariView.swift in Sources */,
6D95DC6E27804AAD00EE8B54 /* AppDetail.swift in Sources */,
6D490E542782F35F00B5DD80 /* Strings.swift in Sources */,
6D26AAC2278420CB003F82BF /* AboutAppView.swift in Sources */,
@@ -645,7 +653,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 2023.04.27;
+ CURRENT_PROJECT_VERSION = 2023.04.29;
DEVELOPMENT_ASSET_PATHS = "\"iAppStore/Preview Content\"";
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
@@ -664,7 +672,7 @@
"@executable_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
- MARKETING_VERSION = 1.4.1;
+ MARKETING_VERSION = 1.5.0;
PRODUCT_BUNDLE_IDENTIFIER = com.37iOS.iApp;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -685,7 +693,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 2023.04.27;
+ CURRENT_PROJECT_VERSION = 2023.04.29;
DEVELOPMENT_ASSET_PATHS = "\"iAppStore/Preview Content\"";
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
@@ -704,7 +712,7 @@
"@executable_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
- MARKETING_VERSION = 1.4.1;
+ MARKETING_VERSION = 1.5.0;
PRODUCT_BUNDLE_IDENTIFIER = com.37iOS.iApp;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
diff --git a/iAppStore/Shared/UI/SafariView.swift b/iAppStore/Shared/UI/SafariView.swift
new file mode 100644
index 0000000..d5bc5d2
--- /dev/null
+++ b/iAppStore/Shared/UI/SafariView.swift
@@ -0,0 +1,26 @@
+//
+// SafariView.swift
+// iAppStore
+//
+// Created by HTC on 2023/4/28.
+// Copyright © 2023 37 Mobile Games. All rights reserved.
+//
+
+import SwiftUI
+import SafariServices
+
+// MARK: - SafariView
+struct SafariView: UIViewControllerRepresentable {
+
+ let url: URL
+
+ func makeUIViewController(context: UIViewControllerRepresentableContext) -> SFSafariViewController {
+ let sf = SFSafariViewController(url: url)
+ sf.dismissButtonStyle = .close
+ return sf
+ }
+
+ func updateUIViewController(_ uiViewController: SFSafariViewController, context: UIViewControllerRepresentableContext) {
+
+ }
+}
diff --git a/iAppStore/components/rankLists/AppContextMenu.swift b/iAppStore/components/rankLists/AppContextMenu.swift
index 80f3daf..332ad2d 100644
--- a/iAppStore/components/rankLists/AppContextMenu.swift
+++ b/iAppStore/components/rankLists/AppContextMenu.swift
@@ -14,6 +14,7 @@ struct AppContextMenu: View {
let bundleID: String?
let appUrl: String?
let developerUrl: String?
+ var showAppDataSize: Bool = true
@AppStorage("kIsShowAppDataSize") private var isShowAppDataSize = false
@@ -55,8 +56,10 @@ struct AppContextMenu: View {
}
}
- CreateMenuItem(text: "\(isShowAppDataSize ? "隐藏" : "显示") App 大小和最低支持系统", imgName: "arrow.down.app") {
- isShowAppDataSize.toggle()
+ if showAppDataSize {
+ CreateMenuItem(text: "\(isShowAppDataSize ? "隐藏" : "显示") App 大小和最低支持系统", imgName: "arrow.down.app") {
+ isShowAppDataSize.toggle()
+ }
}
}
}
@@ -81,6 +84,6 @@ struct AppContextMenu: View {
struct AppContextMenu_Previews: PreviewProvider {
static var previews: some View {
- AppContextMenu(appleID: "123456", bundleID: "iAppStore", appUrl: "https://juejin.cn/user/1002387318511214", developerUrl: "https://juejin.cn/user/1002387318511214")
+ AppContextMenu(appleID: "123456", bundleID: "iAppStore", appUrl: "https://juejin.cn/user/1002387318511214", developerUrl: "https://juejin.cn/user/1002387318511214", showAppDataSize: true)
}
}
diff --git a/iAppStore/components/rankLists/AppDetailContentView.swift b/iAppStore/components/rankLists/AppDetailContentView.swift
index 48e3bd2..a8f0756 100644
--- a/iAppStore/components/rankLists/AppDetailContentView.swift
+++ b/iAppStore/components/rankLists/AppDetailContentView.swift
@@ -34,6 +34,9 @@ struct AppDetailContentView: View {
ScrollView {
// Header Section
AppDetailHeaderView(appModel: appModel, alertType: $alertType)
+ .contextMenu {
+ AppContextMenu(appleID: String(appModel.app?.trackId ?? 0), bundleID: appModel.app?.bundleId, appUrl: appModel.app?.trackViewUrl, developerUrl: appModel.app?.artistViewUrl, showAppDataSize: false)
+ }
// ScreenShot View
AppDetailScreenShowView(appModel: appModel)
diff --git a/iAppStore/components/rankLists/RankCellView.swift b/iAppStore/components/rankLists/RankCellView.swift
index 4fea0f5..5fbb1ca 100644
--- a/iAppStore/components/rankLists/RankCellView.swift
+++ b/iAppStore/components/rankLists/RankCellView.swift
@@ -26,13 +26,13 @@ struct RankCellView: View {
Image("icon_placeholder")
.resizable()
.renderingMode(.original)
- .cornerRadius(15)
+ .cornerRadius(17)
.frame(width: 75, height: 75)
},
image: {
$0.resizable()
.renderingMode(.original)
- .cornerRadius(15)
+ .cornerRadius(17)
.frame(width: 75, height: 75)
}
)
diff --git a/iAppStore/components/search/SearchCellView.swift b/iAppStore/components/search/SearchCellView.swift
index 9c0a3c4..0815a13 100644
--- a/iAppStore/components/search/SearchCellView.swift
+++ b/iAppStore/components/search/SearchCellView.swift
@@ -23,13 +23,13 @@ struct SearchCellView: View {
Image("icon_placeholder")
.resizable()
.renderingMode(.original)
- .cornerRadius(15)
+ .cornerRadius(17)
.frame(width: 75, height: 75)
},
image: {
$0.resizable()
.renderingMode(.original)
- .cornerRadius(15)
+ .cornerRadius(17)
.frame(width: 75, height: 75)
}
)
diff --git a/iAppStore/components/setting/AboutAppView.swift b/iAppStore/components/setting/AboutAppView.swift
index 0870c7f..8c02bf1 100644
--- a/iAppStore/components/setting/AboutAppView.swift
+++ b/iAppStore/components/setting/AboutAppView.swift
@@ -24,12 +24,23 @@ struct AboutAppView: View {
.padding(.bottom, 10)
Text("iAppStore").fontWeight(.bold).padding(.bottom, 5)
Text("v \(appVersion ?? "") (\(appSubVersion ?? ""))").font(.footnote).foregroundColor(.gray).padding(.bottom, 10)
- Text("iAppStore 是一款使用 SwiftUI 打造的苹果商店工具类 App。").padding([.leading, .trailing], 20).padding(.bottom, 10)
+ Text("iAppStore 是一款使用 SwiftUI 打造的苹果商店工具类 App。").padding([.leading, .trailing], 20).padding(.bottom, 5)
Text("1、提供苹果实时榜单查询,包含 iOS 和 iPad 的热门免费榜、热门付费榜、畅销榜,还有新上架榜、新上架免费榜、新上架付费榜等。\n2、提供查询 app 详细页面内容、搜索 app、订阅 app 状态等功能。\n3、支持苹果所有国家和地区的商店,无需切换 Apple Id,即可查看!")
.font(.footnote)
.padding([.leading, .trailing], 20).padding(.bottom, 10)
Spacer()
+ Text("由 **37手游iOS术技运营团队** 发起的开源项目。")
+ .multilineTextAlignment(.center)
+ .font(.subheadline)
+ .padding(.top, 30)
+
+ Text(.init("GitHub: https://github.com/37iOS/iAppStore-SwiftUI"))
+ .multilineTextAlignment(.center)
+ .foregroundColor(.secondary)
+ .font(.footnote)
+ .padding(.top, 10)
+ .padding(.bottom, 30)
}
.navigationTitle("关于 iAppStore")
.navigationBarTitleDisplayMode(.inline)
diff --git a/iAppStore/components/setting/AppleServicesView.swift b/iAppStore/components/setting/AppleServicesView.swift
new file mode 100644
index 0000000..9613b81
--- /dev/null
+++ b/iAppStore/components/setting/AppleServicesView.swift
@@ -0,0 +1,83 @@
+//
+// AppleServicesView.swift
+// iAppStore
+//
+// Created by HTC on 2023/4/28.
+// Copyright © 2023 37 Mobile Games. All rights reserved.
+//
+
+import SwiftUI
+import SafariServices
+
+struct AppleServicesView: View {
+
+ @State private var linkPage: LinkItem? = nil
+ private let apples: [String: String] = [
+ "Apple 中国大陆官网": "https://www.apple.com.cn",
+ "Apple Newsroom": "https://www.apple.com.cn/newsroom/",
+ "App Store Connect": "https://appstoreconnect.apple.com/",
+ "Apple Developer": "https://developer.apple.com/",
+ "Apple News and Updates": "https://www.apple.com/news/",
+ "Apple 新闻及更新": "https://www.apple.com/cn/news/",
+ "App Store Review Guidelines": "https://developer.apple.com/app-store/review/guidelines/",
+ "App Store 审核指南": "https://developer.apple.com/cn/app-store/review/guidelines/",
+ "Apple Services Status - US": "https://www.apple.com/support/systemstatus/",
+ "Apple Services Status - CN": "https://www.apple.com/cn/support/systemstatus/",
+ "Apple System Status": "https://www.apple.com/support/systemstatus/",
+ "Apple 安全性更新": "https://support.apple.com/zh-cn/HT201222",
+ "iOS & iPadOS Release Notes": "https://developer.apple.com/documentation/ios-ipados-release-notes",
+ "Xcode Release": "https://developer.apple.com/documentation/xcode-release-notes",
+ "iOS & iPadOS 普及率": "https://developer.apple.com/support/app-store/",
+ "Software Downloads": "https://developer.apple.com/download/",
+ "App Store Connect 帮助": "https://help.apple.com/app-store-connect/",
+ "iOS 16 更新": "https://www.apple.com/ios/ios-16/",
+ "iPadOS 16 更新": "https://www.apple.com/ipados/ipados-16/",
+ "macOS 13 更新": "https://www.apple.com/macos/macos-13/",
+ "识别你的 iPhone 机型": "https://support.apple.com/zh-cn/HT201296",
+ "识别你的 iPad 机型": "https://support.apple.com/zh-cn/HT201471",
+ "识别 iPod 机型": "https://support.apple.com/zh-cn/HT204217",
+ "识别 MacBook 机型": "https://support.apple.com/zh-cn/HT201608",
+ "识别 MacBook Air 机型": "https://support.apple.com/zh-cn/HT201862",
+ "识别 MacBook Pro 机型": "https://support.apple.com/zh-cn/HT201300",
+ "识别 Mac mini 机型": "https://support.apple.com/zh-cn/HT201894",
+ "识别 Mac Studio 机型": "https://support.apple.com/zh-cn/HT212366",
+ "识别 Mac Pro 机型": "https://support.apple.com/zh-cn/HT201805",
+ "识别你的 iMac 机型": "https://support.apple.com/zh-cn/HT201634",
+ "识别你的 Apple Watch": "https://support.apple.com/zh-cn/HT204507",
+ "识别你的 AirPods": "https://support.apple.com/zh-cn/HT207010",
+ "识别你的 HomePod": "https://support.apple.com/zh-cn/HT208244",
+ "识别你的 Apple TV": "https://support.apple.com/zh-cn/HT200008"
+ ]
+
+ var body: some View {
+ List(apples.keys.sorted(), id: \.self) { title in
+
+ Button(action: {
+ linkPage = LinkItem(url: apples[title]!)
+ }) {
+ HStack {
+ Text(title).foregroundColor(.primary)
+ Spacer()
+ Image(systemName: "chevron.right").imageScale(.small).foregroundColor(Color.tsmg_placeholderText)
+ }
+ .padding([.top, .bottom], 10)
+ }
+ }
+ .sheet(item: $linkPage) { link in
+ SafariView(url: URL(string: link.url)!)
+ }
+ .navigationTitle("苹果常用网站")
+ .navigationBarTitleDisplayMode(.large)
+ }
+}
+
+struct LinkItem: Identifiable {
+ let id = UUID()
+ let url: String
+}
+
+struct AppleServicesView_Previews: PreviewProvider {
+ static var previews: some View {
+ AppleServicesView()
+ }
+}
diff --git a/iAppStore/components/setting/SettingHome.swift b/iAppStore/components/setting/SettingHome.swift
index 9fbf4ad..29e2f45 100644
--- a/iAppStore/components/setting/SettingHome.swift
+++ b/iAppStore/components/setting/SettingHome.swift
@@ -7,8 +7,7 @@
//
import SwiftUI
-import SafariServices
-
+import StoreKit
struct LinkString: Identifiable {
let url: String
@@ -17,10 +16,8 @@ struct LinkString: Identifiable {
struct SettingHome: View {
- private let items = ["切换图标", "AppStore", "蝉应用", "点点数据", "七麦数据"]
- private let apples = ["Apple 中国大陆官网", "Apple Newsroom", "App Store Connect", "Apple Developer", "Apple News and Updates", "Apple 新闻及更新", "App Store Review Guidelines", "App Store 审核指南", "Apple Services Status - US", "Apple Services Status - CN", "Apple System Status", "Apple 安全性更新", "iOS & iPadOS Release Notes", "Xcode Release", "iOS & iPadOS 普及率", "Software Downloads", "App Store Connect 帮助", "iOS 16 更新", "iPadOS 16 更新", "macOS 13 更新", "识别你的 iPhone 机型", "识别你的 iPad 机型", "识别 iPod 机型", "识别 MacBook 机型", "识别 MacBook Air 机型", "识别 MacBook Pro 机型", "识别 Mac mini 机型", "识别 Mac Studio 机型", "识别 Mac Pro 机型", "识别你的 iMac 机型", "识别你的 Apple Watch", "识别你的 AirPods", "识别你的 HomePod", "识别你的 Apple TV"]
-
@State private var linkPage: LinkString? = nil
+ private let items = ["切换图标", "AppStore", "蝉应用", "点点数据", "七麦数据"]
var body: some View {
NavigationView {
@@ -32,6 +29,17 @@ struct SettingHome: View {
}
}
+ Section(header: Text("苹果服务")) {
+ NavigationLink(destination: AppleServicesView()) {
+ HStack {
+ Text("苹果常用网站")
+ Spacer()
+ }
+ .padding([.top, .bottom], 10)
+ }
+ AppleSubscriptionManagerView(linkPage: $linkPage)
+ }
+
Section(header: Text("关于")) {
NavigationLink(destination: AboutAppView()) {
Text("关于应用").frame(height: 50)
@@ -39,13 +47,6 @@ struct SettingHome: View {
SettingItemCell(linkPage: $linkPage, title: "GitHub 开源", index: items.count)
SettingItemCell(linkPage: $linkPage, title: "37手游iOS技术运营团队", index: items.count + 1)
}
-
- Section(header: Text("苹果服务")) {
- ForEach(apples, id: \.self) { title in
- let index = items.count + 2 + apples.firstIndex(of: title)!
- SettingItemCell(linkPage: $linkPage, title: title, index: index)
- }
- }
}
}
.navigationBarTitle("设置")
@@ -57,6 +58,36 @@ struct SettingHome: View {
}
}
+struct AppleSubscriptionManagerView: View {
+
+ @Binding var linkPage: LinkString?
+ private let subscriptionsURL = "https://apps.apple.com/account/subscriptions"
+
+ var body: some View {
+ HStack {
+ Button(action: {
+ Task {
+ if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene {
+ do {
+ if #available(iOS 15.0, *) {
+ try await AppStore.showManageSubscriptions(in: windowScene)
+ } else {
+ linkPage = LinkString(url: subscriptionsURL)
+ }
+ } catch {
+ linkPage = LinkString(url: subscriptionsURL)
+ }
+ }
+ }
+ }) {
+ Text("苹果订阅管理").foregroundColor(Color.primary)
+ }
+ Spacer()
+ Image(systemName: "chevron.right").imageScale(.small).foregroundColor(Color.secondary)
+ }
+ .padding([.top, .bottom], 10)
+ }
+}
struct SettingItemCell: View {
@@ -120,74 +151,6 @@ struct SettingItemCell: View {
linkPage = LinkString(url: "https://github.com/37iOS/iAppStore-SwiftUI")
case 6:
linkPage = LinkString(url: "https://juejin.cn/user/1002387318511214")
- case 7:
- linkPage = LinkString(url: "https://www.apple.com.cn")
- case 8:
- linkPage = LinkString(url: "https://www.apple.com.cn/newsroom/")
- case 9:
- linkPage = LinkString(url: "https://appstoreconnect.apple.com")
- case 10:
- linkPage = LinkString(url: "https://developer.apple.com")
- case 11:
- linkPage = LinkString(url: "https://developer.apple.com/news/")
- case 12:
- linkPage = LinkString(url: "https://developer.apple.com/cn/news/")
- case 13:
- linkPage = LinkString(url: "https://developer.apple.com/app-store/review/guidelines/")
- case 14:
- linkPage = LinkString(url: "https://developer.apple.com/cn/app-store/review/guidelines/")
- case 15:
- linkPage = LinkString(url: "https://www.apple.com/support/systemstatus/")
- case 16:
- linkPage = LinkString(url: "https://www.apple.com/cn/support/systemstatus/")
- case 17:
- linkPage = LinkString(url: "https://developer.apple.com/system-status/")
- case 18:
- linkPage = LinkString(url: "https://support.apple.com/zh-cn/HT201222")
- case 19:
- linkPage = LinkString(url: "https://developer.apple.com/documentation/ios-ipados-release-notes")
- case 20:
- linkPage = LinkString(url: "https://developer.apple.com/cn/support/xcode/")
- case 21:
- linkPage = LinkString(url: "https://developer.apple.com/cn/support/app-store/")
- case 22:
- linkPage = LinkString(url: "https://developer.apple.com/download/")
- case 23:
- linkPage = LinkString(url: "https://developer.apple.com/cn/help/app-store-connect/")
- case 24:
- linkPage = LinkString(url: "https://support.apple.com/zh-cn/HT213407")
- case 25:
- linkPage = LinkString(url: "https://support.apple.com/zh-cn/HT213408")
- case 26:
- linkPage = LinkString(url: "https://support.apple.com/zh-cn/HT213268")
- case 27:
- linkPage = LinkString(url: "https://support.apple.com/zh-cn/HT201296")
- case 28:
- linkPage = LinkString(url: "https://support.apple.com/zh-cn/HT201471")
- case 29:
- linkPage = LinkString(url: "https://support.apple.com/zh-cn/HT204217")
- case 30:
- linkPage = LinkString(url: "https://support.apple.com/zh-cn/HT201608")
- case 31:
- linkPage = LinkString(url: "https://support.apple.com/zh-cn/HT201862")
- case 32:
- linkPage = LinkString(url: "https://support.apple.com/zh-cn/HT201300")
- case 33:
- linkPage = LinkString(url: "https://support.apple.com/zh-cn/HT201894")
- case 34:
- linkPage = LinkString(url: "https://support.apple.com/zh-cn/HT213073")
- case 35:
- linkPage = LinkString(url: "https://support.apple.com/zh-cn/HT202888")
- case 36:
- linkPage = LinkString(url: "https://support.apple.com/zh-cn/HT201634")
- case 37:
- linkPage = LinkString(url: "https://support.apple.com/zh-cn/HT204507")
- case 38:
- linkPage = LinkString(url: "https://support.apple.com/zh-cn/HT209580")
- case 39:
- linkPage = LinkString(url: "https://support.apple.com/zh-cn/HT211109")
- case 40:
- linkPage = LinkString(url: "https://support.apple.com/zh-cn/HT200008")
default: break
}
}) {
@@ -203,25 +166,6 @@ struct SettingItemCell: View {
}
}
-
-
-// MARK: - SafariView
-struct SafariView: UIViewControllerRepresentable {
-
- let url: URL
-
- func makeUIViewController(context: UIViewControllerRepresentableContext) -> SFSafariViewController {
- let sf = SFSafariViewController(url: url)
- sf.dismissButtonStyle = .close
- return sf
- }
-
- func updateUIViewController(_ uiViewController: SFSafariViewController, context: UIViewControllerRepresentableContext) {
-
- }
-}
-
-
struct SettingHome_Previews: PreviewProvider {
static var previews: some View {
SettingHome()
diff --git a/iAppStore/components/subscription/SubscriptionHome.swift b/iAppStore/components/subscription/SubscriptionHome.swift
index 6e1ea78..056ac6e 100644
--- a/iAppStore/components/subscription/SubscriptionHome.swift
+++ b/iAppStore/components/subscription/SubscriptionHome.swift
@@ -81,13 +81,13 @@ struct SubscripteCellView: View {
Image("icon_placeholder")
.resizable()
.renderingMode(.original)
- .cornerRadius(15)
+ .cornerRadius(17)
.frame(width: 75, height: 75)
},
image: {
$0.resizable()
.renderingMode(.original)
- .cornerRadius(15)
+ .cornerRadius(17)
.frame(width: 75, height: 75)
}
)