Skip to content

Commit

Permalink
v1.5.0
Browse files Browse the repository at this point in the history
1、新增 App Store 新风格图标
2、新增 App Store 订阅内容管理
3、App 详细页面,长按顶部视图,可复制 AppID、BundleID 和商店链接等
4、苹果服务网页,移到二级列表中显示
5、优化一些体验小细节
  • Loading branch information
iHTCboy committed Apr 28, 2023
1 parent d2586f0 commit 7f72dc0
Show file tree
Hide file tree
Showing 11 changed files with 223 additions and 123 deletions.
42 changes: 32 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# iAppStore

## 简介
## 1. 项目介绍

iAppStore 是一款使用 SwiftUI 打造的苹果商店工具类 App。

Expand All @@ -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**

Expand All @@ -39,7 +61,7 @@ iAppStore 是一款使用 SwiftUI 打造的苹果商店工具类 App。
<img src="screenshot/08.png" width="800" height:auto alt="screenshot/08.png"/>
<img src="screenshot/09.png" width="800" height:auto alt="screenshot/09.png"/>

### TODO
## 4. TODO

1. [x] 请求失败导致页面空白的处理(2022-02-02)
2. [] 数据请求可以按分页请求加载
Expand All @@ -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)

Expand Down
16 changes: 12 additions & 4 deletions iAppStore.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -67,6 +69,8 @@
6C51177327A2755000D5E21D /* NetworkManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkManager.swift; sourceTree = "<group>"; };
6C51177427A2755100D5E21D /* NetworkMonitor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkMonitor.swift; sourceTree = "<group>"; };
6C9A423D27A637E60074FD09 /* LoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingView.swift; sourceTree = "<group>"; };
6D0809DB29FB576100D12E21 /* AppleServicesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleServicesView.swift; sourceTree = "<group>"; };
6D0809DD29FB5FA500D12E21 /* SafariView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariView.swift; sourceTree = "<group>"; };
6D26AAC1278420CB003F82BF /* AboutAppView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutAppView.swift; sourceTree = "<group>"; };
6D490E532782F35F00B5DD80 /* Strings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Strings.swift; sourceTree = "<group>"; };
6D490E55278328E400B5DD80 /* SubscriptionAddView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionAddView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -186,6 +190,7 @@
children = (
6D738E2D2779736B00A4A76E /* SettingHome.swift */,
6D26AAC1278420CB003F82BF /* AboutAppView.swift */,
6D0809DB29FB576100D12E21 /* AppleServicesView.swift */,
);
path = setting;
sourceTree = "<group>";
Expand Down Expand Up @@ -215,6 +220,7 @@
children = (
6DB3B796277EEC7100E8626F /* ImageLoader.swift */,
6C9A423D27A637E60074FD09 /* LoadingView.swift */,
6D0809DD29FB5FA500D12E21 /* SafariView.swift */,
);
path = UI;
sourceTree = "<group>";
Expand Down Expand Up @@ -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 */,
Expand All @@ -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 */,
Expand Down Expand Up @@ -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;
Expand All @@ -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 = "";
Expand All @@ -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;
Expand All @@ -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 = "";
Expand Down
26 changes: 26 additions & 0 deletions iAppStore/Shared/UI/SafariView.swift
Original file line number Diff line number Diff line change
@@ -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<SafariView>) -> SFSafariViewController {
let sf = SFSafariViewController(url: url)
sf.dismissButtonStyle = .close
return sf
}

func updateUIViewController(_ uiViewController: SFSafariViewController, context: UIViewControllerRepresentableContext<SafariView>) {

}
}
9 changes: 6 additions & 3 deletions iAppStore/components/rankLists/AppContextMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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()
}
}
}
}
Expand All @@ -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)
}
}
3 changes: 3 additions & 0 deletions iAppStore/components/rankLists/AppDetailContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions iAppStore/components/rankLists/RankCellView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
)
Expand Down
4 changes: 2 additions & 2 deletions iAppStore/components/search/SearchCellView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
)
Expand Down
13 changes: 12 additions & 1 deletion iAppStore/components/setting/AboutAppView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
83 changes: 83 additions & 0 deletions iAppStore/components/setting/AppleServicesView.swift
Original file line number Diff line number Diff line change
@@ -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()
}
}
Loading

0 comments on commit 7f72dc0

Please sign in to comment.