Autumn Sale50% offCOMPOT
Icons & BadgesFree ComponentiOS 16.0+Xcode 15+

App Icon 75x75 using AppIcon

Dynamically loaded main application icon container with standard iOS corner radius.

SwiftUI Implementation

Pure Vanilla Swift • No Dependencies
appIcon75UsingAppIcon.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

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 Store