All Projects → darrarski → swiftui-app-icon-creator

darrarski / swiftui-app-icon-creator

Licence: MIT license
Create iOS and macOS application icon in Xcode with SwiftUI

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to swiftui-app-icon-creator

SwiftUI-App
This swiftUI Demo is very simple & easy to understand. This swiftUI demo includes On-boarding screens, login screen, forgot password screen, sign up screen, home & logout.
Stars: ✭ 175 (+201.72%)
Mutual labels:  swift-ui, swiftui
aprenda-swift
Uma lista de conteúdos para você aprender Swift
Stars: ✭ 429 (+639.66%)
Mutual labels:  swift-ui, swiftui
XUI
XUI makes modular, testable architectures for SwiftUI apps a breeze!
Stars: ✭ 100 (+72.41%)
Mutual labels:  swift-ui, swiftui
Bursts
A Funny Framework is showing alerts, Have been Adapting Swift and SwiftUI
Stars: ✭ 11 (-81.03%)
Mutual labels:  swiftui
MVVM-in-SwiftUI
MVVM in SwiftUI (WWDC Player)
Stars: ✭ 60 (+3.45%)
Mutual labels:  swiftui
AppClipCodeGenerator
App Clip Code Generator macOS App built with SwiftUI
Stars: ✭ 75 (+29.31%)
Mutual labels:  swiftui
SwiftyUIScrollView
A custom ScrollView wrapper that comes with Pagination and Page Control.
Stars: ✭ 18 (-68.97%)
Mutual labels:  swiftui
IrregularGradient
Create animated irregular gradients in SwiftUI.
Stars: ✭ 127 (+118.97%)
Mutual labels:  swiftui
CombineUnsplash
A sample project exploring MVVM pattern with SwiftUI/Combine, using Unsplash API (via Picsum.photos API)
Stars: ✭ 25 (-56.9%)
Mutual labels:  swiftui
LongWeekend-iOS
🏖📱 LongWeekend is iOS Application that supports checking long weekends when taking a vacation in Japan
Stars: ✭ 19 (-67.24%)
Mutual labels:  swiftui
app
💥 a modern xkcd iOS client
Stars: ✭ 31 (-46.55%)
Mutual labels:  swiftui
stinsen
Coordinators in SwiftUI. Simple, powerful and elegant.
Stars: ✭ 563 (+870.69%)
Mutual labels:  swiftui
NumberTicker
Robinhood-like Rotating Number View | SwiftUI
Stars: ✭ 34 (-41.38%)
Mutual labels:  swiftui
icon-generator
Generate icons and launch screens for your Adobe AIR projects.
Stars: ✭ 24 (-58.62%)
Mutual labels:  app-icon-generator
RChat
No description or website provided.
Stars: ✭ 58 (+0%)
Mutual labels:  swiftui
DarkModeSwitcher
Simple app for overriding light mode per app on macOS (demo for a blog post)
Stars: ✭ 37 (-36.21%)
Mutual labels:  swiftui
NavigationRouter
A router implementation designed for complex modular apps, written in Swift
Stars: ✭ 89 (+53.45%)
Mutual labels:  swiftui
LineChartView
An interactive line chart written in SwiftUI with many customizations (colors, line size, dots, haptic feedbacks). Support value and time series.
Stars: ✭ 59 (+1.72%)
Mutual labels:  swiftui
RealmTaskTracker
SwiftUI version of the MongoDB Realm iOS tutorial
Stars: ✭ 24 (-58.62%)
Mutual labels:  swiftui
Micro
🏎Fast diffing and type safe SwiftUI style data source for UICollectionView
Stars: ✭ 77 (+32.76%)
Mutual labels:  swiftui

SwiftUI App Icon Creator

Swift 5 platform macOS 11

Create iOS and macOS application icon in Xcode with SwiftUI

Xcode 12 and macOS 11 required

Creating app icon in Xcode - screenshot

Dark mode supported

Creating app icon in Xcode - screenshot

📝 How to

TL;DR: check out example project in this repository.

1️⃣ Create a new Swift Package

Define two products in your Package.swift:

  • Library that will contain your icon source code
  • Executable that you will use to export icon images

Add swiftui-app-icon-creator package as a dependency.

Your Package.swift should like this:

// swift-tools-version:5.3
import PackageDescription

let package = Package(
  name: "my-app-icon",
  platforms: [.macOS(.v11)],
  products: [
    .library(name: "MyAppIcon", targets: ["MyAppIcon"]),
    .executable(name: "export", targets: ["Export"])
  ],
  dependencies: [
    .package(url: "https://github.com/darrarski/swiftui-app-icon-creator.git", from: "1.0.0")
  ],
  targets: [
    .target(name: "MyAppIcon", dependencies: [
      .product(name: "AppIconCreator", package: "swiftui-app-icon-creator")
    ]),
    .target(name: "Export", dependencies: ["MyAppIcon"])
  ]
)

2️⃣ Create an icon view in the library target, using SwiftUI

Just create a new SwiftUI view in the library target:

import SwiftUI

public struct MyAppIconView: View {
  public init() {}

  public var body: some View {
    // ...  
  }
}

3️⃣ Use IconPreviews to live-preview your icon in Xcode

Add this code to the file which contains your icon view:

import AppIconCreator

struct MyAppIconView_Preivews: PreviewProvider {
  static var previews: some View {
    IconPreviews(
      icon: MyAppIconView(),
      configs: .iOS
    )
  }
}

Make sure you have selected the build scheme connected with your library target (MyAppIcon in this example).

You should be able to live-preview the icon in Xcode previews.

You can adjust the configs parameter to specify which types of icons you want to preview. Check out IconConfig.swift for possible options.

4️⃣ Add exporting code to the executable target

Add this code to main.swift file in your executable target:

import AppIconCreator
import MyAppIcon
import Foundation

let icon = MyAppIconView()
let configs = [IconConfig].iOS
let images = [IconImage].images(for: icon, with: configs)
let exportURL = FileManager.default.homeDirectoryForCurrentUser.appendingPathComponent("Desktop").appendingPathComponent("MyAppIcon")
images.forEach { $0.save(to: exportURL) }

You can adjust the configs variable to specify which types of icons you want to export. Check out IconConfig.swift for possible options.

In the above example, the images will be exported to MyAppIcon directory on the current user's desktop. Feel free to adjust the exportURL variable to your needs.

5️⃣ Run the executable from Xcode to export your icon images

Make sure you have selected the build scheme connected with your executable target (export in this example).

Images of your icon should be exported into a directory specified in exportURL variable.

☕️ Do you like the project?

Buy Me A Coffee

📄 License

Copyright © 2020 Dariusz Rybicki Darrarski

License: MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].