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
+19 -7

No files matched your search

+5 -4
View File
@@ -22,9 +22,10 @@ extension Bundle {
extension UIImage { extension UIImage {
var appIcon: Image { var appIcon: Image {
let fallback = Image(uiImage: UIImage()) // let fallback = Image(uiImage: UIImage())
guard let filename = Bundle.main.iconFilename else { return fallback } // guard let filename = Bundle.main.iconFilename else { return fallback }
guard let uiImage = UIImage(named: filename) else { return fallback } // guard let uiImage = UIImage(named: filename) else { return fallback }
return Image(uiImage: uiImage) // return uiImage
return Image("Icon")
} }
} }
+13 -2
View File
@@ -8,15 +8,26 @@
import SwiftUI import SwiftUI
struct AboutView: View { struct AboutView: View {
@ObservedObject var hostsManager: HostsManager
var body: some View { var body: some View {
ZStack {
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
.ignoresSafeArea(.all)
List {
HStack { HStack {
UIImage().appIcon UIImage().appIcon
Image(uiImage: UIImage(named: "AppIcon") ?? UIImage()) .resizable().scaledToFit()
.frame(width: 100)
.clipShape(RoundedRectangle(cornerRadius: 26))
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
} }
} }
.scrollContentBackground(.hidden)
}
}
} }
#Preview { #Preview {
AboutView() AboutView(hostsManager: HostsManager())
} }
+1 -1
View File
@@ -65,7 +65,7 @@ struct ContentView: View {
Section { Section {
NavigationLink { NavigationLink {
AboutView() AboutView(hostsManager: hostsManager)
} label: { } label: {
Label("About", systemImage: "info.square") 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.