A macOS SwiftUI application for editing interface styles and generating style snippets.
- Visual style editor for interface components
- Real-time preview of style changes
- JSON snippet generation
- Color picker integration
- Border radius controls
- Token-based styling system
- Open
ZenlyticStyleEditor.xcodeprojin Xcode - Select the "ZenlyticStyleEditor" target
- Choose your Mac as the destination device
- Click the "Run" button (
▶️ ) or pressCmd+R
The app should launch and display the style editor interface.
If the app doesn't launch from Xcode, try these steps:
- Clean Build Folder: In Xcode, go to
Product→Clean Build Folder(or pressCmd+Shift+K) - Reset Package Caches: In Xcode, go to
File→Packages→Reset Package Caches - Check Code Signing: Ensure code signing is set to "Manual" in the project settings
- Verify Entitlements: The app uses minimal entitlements to avoid sandboxing issues
If Xcode stops at a breakpoint when launching the app:
- Click the Continue button (
▶️ ) in the debugger toolbar - Or press Cmd+Option+P to continue execution
- Run the reset script:
./reset_xcode_debugger.sh - Close Xcode completely
- Reopen the project
- Run the app - it should launch without stopping
- Remove All Breakpoints: Debug → Breakpoints → Remove All Breakpoints
- Toggle Breakpoints Off: Press Cmd+Y to disable breakpoints
- Check Exception Breakpoints: In Breakpoint Navigator, disable any exception breakpoints
The following changes were made to ensure the app launches properly from Xcode:
- Code Signing: Changed from "Automatic" to "Manual" to avoid signing issues
- Hardened Runtime: Disabled to prevent launch restrictions
- Development Team: Removed to avoid team-specific signing requirements
- Bundle Identifier: Updated to
com.zenlytic.styleeditor - App Delegate: Simplified window management to prevent launch hangs
- Info.plist: Added explicit Info.plist file for proper app metadata
- Debugger Configuration: Added settings to prevent unwanted debugger stops
ZenlyticStyleEditor/
├── Models/
│ └── StyleModels.swift # Data models for styles and components
├── ViewModels/
│ └── StyleEditorViewModel.swift # Main view model and business logic
├── Views/
│ ├── StyleEditorView.swift # Main editor interface
│ ├── SidebarView.swift # Component selection sidebar
│ ├── PreviewPanel.swift # Live preview of selected component
│ ├── SnippetOutputView.swift # JSON snippet output
│ ├── PaletteEditorView.swift # Color palette editor
│ └── StyleKeyRow.swift # Individual style key editor
├── Resources/
│ ├── interface_styles.json # Sample interface styles
│ └── token_palette.json # Color and token definitions
├── Assets.xcassets/ # App icons and assets
├── ContentView.swift # Main content view
├── ZenlyticStyleEditorApp.swift # App entry point
├── Info.plist # App metadata
└── reset_xcode_debugger.sh # Script to reset debugger state
The app is built with SwiftUI and follows the MVVM pattern:
- Models: Define the data structures for styles, components, and tokens
- ViewModels: Handle business logic and state management
- Views: Provide the user interface using SwiftUI
- StyleEditorViewModel: Manages the main app state, loads data, and handles style updates
- StyleComponent: Represents a UI component with configurable style keys
- StyleKey: Individual style properties (colors, border radius, etc.)
- Token System: References to predefined design tokens for consistent styling
The app loads two main JSON files:
- interface_styles.json: Contains component definitions with their style keys
- token_palette.json: Contains the design token system (colors, spacing, etc.)
These files are bundled with the app and loaded at startup.
- macOS 15.5 or later
- Xcode 16.4 or later
- Swift 5.0+