---
title: IconMuse for iOS, macOS and SwiftUI
description: Add IconMuse music icons to an iOS or macOS app with one command, then use them in SwiftUI or UIKit like SF Symbols.
---

# IconMuse for iOS and macOS

One command adds the icons to your Xcode project. You need [Node.js](https://nodejs.org) 18 or later on your Mac to run it; your app itself doesn't use Node.

## 1. Add the icons

In Terminal, go to your app's folder (the one containing the `.xcodeproj`):

```bash
cd path/to/your-ios-app
npx iconmuse generate --dry-run   # preview what it will add
npx iconmuse generate             # add the icons
```

It finds your app's `Assets.xcassets` and adds two items next to it:

```text
YourApp/
├── Assets.xcassets      (yours, untouched)
├── IconMuse.xcassets    (new: every icon as a vector image)
└── IconMuse.swift       (new: a Swift enum listing every icon)
```

To add only the icons you need:

```bash
npx iconmuse generate --icons play,pause,vinyl
```

## 2. Check Xcode includes them

- **Projects created in Xcode 16 or later:** nothing to do. New files in the folder appear automatically.
- **Older projects:** in Xcode, right-click your app's folder, choose **Add Files to "YourApp"…**, select `IconMuse.xcassets` and `IconMuse.swift`, and tick your app target. You only need to do this once.

## 3. Use the icons

```swift
// SwiftUI
IconMuse.play.image
    .resizable()
    .frame(width: 24, height: 24)
    .foregroundStyle(.purple)

Label { Text("Play") } icon: { IconMuse.play.image }

// UIKit
let icon = UIImage(named: IconMuse.vinyl.rawValue)
button.setImage(icon, for: .normal)
button.tintColor = .systemPurple
```

- **Tinting:** icons are template images, so they take the colour you set, like SF Symbols.
- **Sharp at any size:** they're vectors.
- **Autocomplete:** names are camelCase (`guitar-electric` becomes `IconMuse.guitarElectric`), and Xcode suggests them all.

## Line thickness (stroke)

Icons are drawn with a 1.5 line by default. On iOS, the thickness is fixed into the images when they're generated, so choose it with `--stroke`, using a value between 0.5 and 3:

```bash
npx iconmuse generate --stroke 2      # bolder
npx iconmuse generate --stroke 1      # lighter
```

To change it later, run the command again with a different value. The website's **Stroke** slider shows what each value looks like.

## Updating

Run `npx iconmuse generate` again in the same folder. It only replaces `IconMuse.xcassets` and `IconMuse.swift`, never your own code or assets. Include the same `--stroke` value if you used one.

## Finding icon names

Browse them at https://icons.chordmuse.app, or in Terminal:

```bash
npx iconmuse list --search guitar
```
