[中文]
Encapsulation of My Personal App List
✦ My macOS/iOS application ✦
Welcome to download DevTutor, a cheat sheet app designed to help developers quickly build excellent applications using SwiftUI.
You can add MyAppListKit to an Xcode project by adding it as a package dependency.
- From the File menu, select Add Packages…
- Enter https://github.com/jaywcjlove/MyAppListKit in the Search or Enter Package URL search field
- Link
MyAppListKit
to your application target
Or add the following to Package.swift
:
.package(url: "https://github.com/jaywcjlove/MyAppListKit", branch: "main")
import MyAppListKit
List {
ForEach(MyAppList.apps(), id: \.appId) { app in
Button(app.name, action: {
app.openApp()
// or
MyAppList.openApp(appId: app.appId, appstoreId: app.appstoreId)
})
}
}
Button("More Apps by Me") {
MyAppList.openURL(url: URL(string: MyAppList.appsByMe)!)
// or
MyAppList.openAppsByMe()
}
MyAppList.appDevHub // -> AppData
MyAppList.appDevHub.storeURL // -> URL: macappstore://apps.apple.com/app/id6476452351
MyAppList.appDevHub.appStoreWriteReview // -> URL: macappstore://apps.apple.com/app/id6476452351?action=write-review
MyAppList.appDevHub.openURL() // Open in browser
MyAppList.appDevHub.openWriteReviewURL() // Open WriteReview in browser
MyAppList.appDevHub.openApp() // Open the app or its store download page
MyAppList.appDevHub.openWriteReviewURL() // Open the app or its store download page
Returns the URL of the default app associated with the given bundle identifier.
MyAppList.appDevHub.appURL()
Checks if the app is installed
MyAppList.isAppInstalled(appId: "com.wangchujiang.daybar")
Get app icon
MyAppList.getAppIcon() // Get the app's App Store icon
// Get icon using bundleIdentifier (if app is installed locally)
MyAppList.getAppIcon(forId: "com.wangchujiang.vidwall")
// Get icon using bundleIdentifier; if not found locally, fallback to App Store icon
MyAppList.getAppIcon(forId: "com.wangchujiang.vidwall", defaultAppStore: true)
// Get icon using bundleIdentifier; if not found locally, fetch from App Store using appstoreId
MyAppList.getAppIcon(forId: "com.wangchujiang.vidwall", appstoreId: "6747587746")
// Fetch icon directly from App Store using the app's ID
MyAppList.fetchAppIconFromAppStore(appId: "6747587746")
import MyAppListKit
struct ContentView: View {
var body: some View {
MyAppCheckForUpdatesView(app: MyAppList.appIconed)
MyAppCheckForUpdatesView(app: MyAppList.appIconed) { label in
HStack {
Text(label)
Spacer()
Image(systemName: "chevron.right")
}
}
.frame(maxWidth: .infinity)
.buttonStyle(.link)
}
}
Display My Apps on the Menu.
struct CommandMenus: Commands {
var body: some Commands {
//CommandMenu("More Tools") {
// MoreAppsView()
//}
MoreAppsCommandMenus()
MoreAppsCommandMenus() {
Group {
// ....
}
}
CommandGroup(replacing: CommandGroupPlacement.help) {
MoreAppsMenuView()
}
}
}
A button that guides users to rate or review the app on the App Store. When clicked, it opens the “Write a Review” page for the current app.
struct CommandMenus: Commands {
var body: some Commands {
CommandGroup(replacing: CommandGroupPlacement.help) {
ButtonWebsite(app: MyAppList.appRegexMate)
ButtonRateApp(app: MyAppList.appRegexMate)
Divider()
ButtonSendFeedback(app: MyAppList.appRegexMate)
}
}
}
import MyAppListKit
@main
struct IconizeFolderApp: App {
var body: some Scene {
return Window("", id: "MainWindow") {
ContentView()
}
.commands {
MoreAppsCommandMenus()
}
}
}
ForEach(MyAppList.apps(), id: \.appId) { app in
Button(action: {
MyAppList.openApp(appId: app.appId, appstoreId: app.appstoreId)
}, label: {
Label(title: {
VStack(alignment: .leading) {
Text(app.name).font(.system(size: 12))
.multilineTextAlignment(.leading)
if let desc = app.desc {
Text(desc.localized(locale: locale))
.lineLimit(nil)
.fixedSize(horizontal: false, vertical: true)
.foregroundStyle(Color.secondary)
.font(.system(size: 10))
.multilineTextAlignment(.leading)
.lineSpacing(0)
.frame(maxWidth: .infinity, alignment: .leading)
}
}
.frame(maxWidth: .infinity, alignment: .leading)
}, icon: {
MoreAppsIcon(appId: app.appId, appstoreId: app.appstoreId)
})
})
.buttonStyle(.link)
}
Licensed under the MIT License.