🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

swift-macos

by @tenequm

Comprehensive macOS app development with Swift 6.2, SwiftUI, SwiftData, Swift Concurrency, Foundation Models, Swift Testing, ScreenCaptureKit, and app distri...

πŸ’‘ Examples

import SwiftUI
import SwiftData

@Model final class Project { var name: String var createdAt: Date @Relationship(deleteRule: .cascade) var tasks: [Task] = []

init(name: String) { self.name = name self.createdAt = .now } }

@Model final class Task { var title: String var isComplete: Bool var project: Project?

init(title: String) { self.title = title self.isComplete = false } }

@main struct MyApp: App { var body: some Scene { WindowGroup("Projects") { ContentView() } .modelContainer(for: [Project.self, Task.self]) .defaultSize(width: 900, height: 600)

#if os(macOS) Settings { SettingsView() }

MenuBarExtra("Status", systemImage: "circle.fill") { MenuBarView() } .menuBarExtraStyle(.window) #endif } }

struct ContentView: View { @Query(sort: \Project.createdAt, order: .reverse) private var projects: [Project]

@Environment(\.modelContext) private var context @State private var selected: Project?

var body: some View { NavigationSplitView { List(projects, selection: $selected) { project in NavigationLink(value: project) { Text(project.name) } } .navigationSplitViewColumnWidth(min: 200, ideal: 250) } detail: { if let selected { DetailView(project: selected) } else { ContentUnavailableView("Select a Project", systemImage: "sidebar.left") } } } }

View on ClawHub
TERMINAL
clawhub install swift-macos

πŸ§ͺ Use this skill with your agent

Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

πŸ” Can't find the right skill?

Search 60,000+ AI agent skills β€” free, no login needed.

Search Skills β†’