got it to return the high quality icon from the asset catalog

made the about view look nicer
This commit is contained in:
neon443 committed 2025-08-03 10:36:01 +01:00
1 parent 425e03223e
commit 18d708cf0c
3 files changed
+22 -10

No files matched your search

+5 -4
View File
@@ -22,9 +22,10 @@ extension Bundle {
extension UIImage {
var appIcon: Image {
let fallback = Image(uiImage: UIImage())
guard let filename = Bundle.main.iconFilename else { return fallback }
guard let uiImage = UIImage(named: filename) else { return fallback }
return Image(uiImage: uiImage)
// let fallback = Image(uiImage: UIImage())
// guard let filename = Bundle.main.iconFilename else { return fallback }
// guard let uiImage = UIImage(named: filename) else { return fallback }
// return uiImage
return Image("Icon")
}
}
+16 -5
View File
@@ -8,15 +8,26 @@
import SwiftUI
struct AboutView: View {
@ObservedObject var hostsManager: HostsManager
var body: some View {
HStack {
UIImage().appIcon
Image(uiImage: UIImage(named: "AppIcon") ?? UIImage())
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
ZStack {
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
.ignoresSafeArea(.all)
List {
HStack {
UIImage().appIcon
.resizable().scaledToFit()
.frame(width: 100)
.clipShape(RoundedRectangle(cornerRadius: 26))
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
}
}
.scrollContentBackground(.hidden)
}
}
}
#Preview {
AboutView()
AboutView(hostsManager: HostsManager())
}
+1 -1
View File
@@ -65,7 +65,7 @@ struct ContentView: View {
Section {
NavigationLink {
AboutView()
AboutView(hostsManager: hostsManager)
} label: {
Label("About", systemImage: "info.square")
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.