App Icon 75x75 using AppIcon
Dynamically loaded main application icon container with standard iOS corner radius.
SwiftUI Implementation
Pure Vanilla Swift • No DependenciesappIcon75UsingAppIcon.swift
// Place image named "AppIcon" into Assets in your XCode project
enum AppIconProvider {
static func appIcon(in bundle: Bundle = .main) -> String? {
guard let icons = bundle.object(forInfoDictionaryKey: "CFBundleIcons") as? [String: Any],
let primaryIcon = icons["CFBundlePrimaryIcon"] as? [String: Any],
let iconFiles = primaryIcon["CFBundleIconFiles"] as? [String],
let iconFileName = iconFiles.last else {
return nil
}
return iconFileName
}
}
struct AppIcon: View {
let appIcon: String
var body: some View {
if let appIcon = UIImage(named: appIcon) {
Image(uiImage: appIcon)
.resizable()
.aspectRatio(contentMode: .fit)
.clipShape(RoundedRectangle(cornerRadius: 15, style: .continuous))
} else {
// Fallback icon or placeholder
Image(systemName: "app.fill")
.resizable()
.aspectRatio(contentMode: .fit)
.foregroundColor(.accentColor)
.clipShape(RoundedRectangle(cornerRadius: 15, style: .continuous))
}
}
}
struct AppIcon75UsingAppIcon: View {
var body: some View {
VStack {
AppIcon(appIcon: AppIconProvider.appIcon() ?? "AppIcon")
}
.frame(width: 75, height: 75)
.shadow(color: .gray.opacity(0.4), radius: 4)
}
}
#Preview {
AppIcon75UsingAppIcon()
}Ready to copy and paste directly into any Xcode project running iOS 16.0+.
Recommended Use Cases
- First-run onboarding flows and feature introductions
- App settings, preferences, and account configuration screens
Component Details
- Category
- Icons & Badges
- iOS Compatibility
- iOS 16.0+
- Xcode Version
- Xcode 15+
- Platform
- iOS
- License Tier
- Free
- Themes & Contexts
- settingsonboardingaccount
C
Compot for iOS
Native SwiftUI playground app
Preview all 130+ components interactively on your device and copy code straight to Xcode with 1 tap.
Get Compot on the App StoreRelated SwiftUI Components
More components in Icons & Badges and related app architectures.
ButtonsiOS 16.0+
Primary Button Basic
High-emphasis prominent action button with standard SwiftUI prominence styling and haptic feedback.
View Component & Code
ButtonsiOS 16.0+
CTA Button Large Basic
Full-width, high-impact call-to-action button designed for onboarding screens, welcome flows, and paywalls.
View Component & Code
ButtonsiOS 16.0+
Secondary Button Basic
Medium-emphasis secondary action button styled for alternative user workflows and dismissal actions.
View Component & Code