Skip to content

SwiftGUI is API inspired by SwiftUI declarative code, using Immediate Mode GUI (Dear ImGui) and running on OSX (min. High Sierra) and iOS (min. 11).

License

Notifications You must be signed in to change notification settings

franciscoamado/SwiftGUI

 
 

Repository files navigation

SwiftGUI (Dear ImGui + SwiftUI inspired API)

license swift version Carthage Compatible

SwiftGUI is an experimental API inspired by SwiftUI declarative code, using Dear ImGui and running on OSX and iOS.

Hello world

Window("SwiftGUI") {

    Text("Hello world!")
    
    HStack {
        RadioButtonGroup(["radio a", "radio b", "radio c"],
                         selectedState: radioState) {
            self.radioState = $0
        }
    }
    
    HStack {
        ForEach(1...7) { val in
            Button("Click \(val)")
        }
    }
}

Carthage

Carthage is intended to be the simplest way to add frameworks to your Cocoa application. Builds your dependencies and provides you with binary frameworks, but you retain full control over your project structure and setup. Carthage does not automatically modify your project files or your build settings.

To integrate SwiftGUI into your Xcode project using Carthage, specify it in your Cartfile:

github "erickjung/SwiftGUI" "0.6.1"

For OSX project, run:

carthage update --platform macOS

For iOS project, run:

carthage update --platform iOS

Features

Theme support

- Color scheme (embedded Darcula and Light)
- Custom Fonts (embedded FiraCode and DroidSans)

Widgets

- Buttons
- CheckBox
- Color Selection
- ComboBox
- Drag
- Dock
- Image
- InputFields
- Lists
- Menu
- Plotting
- Popup
- RadioButton
- SelectableFields
- Sliders
- TabBar
- Texts
- Text Editor (Code editor)
- Tooltips
- Tree
- Window
- General 
    - Group
    - HStack
    - Separator/NewLine/Spacing/Indent
    - ForEach
    - Perform

Projects

  • SwiftGUI-Core: Internal framework abstraction for cimgui
  • SwiftGUI-PlatformiOS: Specific iOS renderer/handler code
  • SwiftGUI-PlatformOSX: Specific OSX renderer/handler code
  • SwiftGUI: The SwiftUI inspired API code
  • Demos: Samples for OSX and iOS
    • Sample01-OSX: General app to show how widgets works
    • Sample02-OSX: Simple functional TODO app
    • Sample01-iOS: General app to show how widgets works

Samples

Sample01 (OSX)

screenshot01

screenshot02_code_editor

Sample 02 (OSX) - Simple TODO application

screenshot02

Screenshot 01 (iOS)

screenshotios

License

  • MIT

Uses

About

SwiftGUI is API inspired by SwiftUI declarative code, using Immediate Mode GUI (Dear ImGui) and running on OSX (min. High Sierra) and iOS (min. 11).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 99.4%
  • Objective-C 0.6%