Programmatic UI for macOS

Overview

MIT Status platform Lang SPM  compatible codebeat badge

Description:

Programmatic UI Framework for macOS. Swift handles app logic, CSS/SVG handles design and JSON handles struture.

img

Installation:

Step 1: Add this to your Package.swift Tutorial

import PackageDescription
let package = Package(
    name: "AwesomeApp",
    dependencies: [
	   .Package(url: "https://github.com/eonist/Element.git", Version(0, 0, 0, prereleaseIdentifiers: ["alpha", "5"]))
    ]
)

Step 2: In AppDelegate.swift add this to the top @testable import Element and @testable import Utilsand this inside the applicationDidFinishLaunching method:

StyleManager.addStyle("Button{fill:blue;}")
let btn = Button(100,20)
let window = NSApp.windows[0]
window.contentView = InteractiveView()/*TopLeft orientation*/
window.contentView?.addSubview(btn)
btn.addHandler(.upInside) = { (event:ButtonEvent) in
   Swift.print("hello world")
}

You can also compile Element as a regular .framework instructions here

Resources:

  • Simple example app made with Element: Stash
  • Library of example code for each component in Element: Explorer
  • Default macOS styles to get you started: ElCapitan

iOS:

Element for 📱 is in the works here
img

More...

More about Element 👉 wiki

Sponsors:

img

You might also like...
Create macOS apps with Swift packages instead of Xcode projects

Swift Bundler A Swift Package Manager wrapper that allows the creation of MacOS apps with Swift packages instead of Xcode projects. My motivation is t

A spotlight-inspired quick action bar for macOS.
A spotlight-inspired quick action bar for macOS.

DSFQuickActionBar A spotlight-inspired quick action bar for macOS. Why? I've seen this in other mac applications (particularly spotlight) and it's ver

Dump local MacOS user hashes to a hashcat-compatible string.

mimic Dumps local MacOS user hashes to a hashcat-compatible string. Simply uses Objective-C instead of dscl/defaults read or other noisy binaries, to

A powerful Swift programmatic UI layout framework.
A powerful Swift programmatic UI layout framework.

Build dynamic and beautiful user interfaces like a boss, with Swift. Neon is built around how user interfaces are naturally and intuitively designed.

An alternative SwiftUI NavigationView implementing classic stack-based navigation giving also some more control on animations and programmatic navigation.
An alternative SwiftUI NavigationView implementing classic stack-based navigation giving also some more control on animations and programmatic navigation.

swiftui-navigation-stack An alternative SwiftUI NavigationView implementing classic stack-based navigation giving also some more control on animations

A wrapper for NavigationView and NavigationLink that makes programmatic navigation a little friendlier.

NavigatorKit A wrapper for NavigationView and NavigationLink that makes programmatic navigation a little friendlier. NavigatorKit is an opinionated wr

Convenient domain specific language for writing programmatic UI built over UIKit and more.

XYKit Swifty and convenient domain specific language for creating programmatic UI in a more declarative way and more than that. Built on top of UIKit

Programmatic view layout for the rest of us.
Programmatic view layout for the rest of us.

Façade Important Facade is no longer under active development, and as such if you create any issues or submit pull requests, it's not very likely to b

Concise Auto Layout API to chain programmatic constraints while easily updating existing constraints.
Concise Auto Layout API to chain programmatic constraints while easily updating existing constraints.

Concise API for Auto Layout. SnapLayout extends UIView and NSView to deliver a list of APIs to improve readability while also shortening constraint co

Programmatic creation of NSAttributedString doesn't have to be a pain
Programmatic creation of NSAttributedString doesn't have to be a pain

Tribute let string = NSMutableAttributedString().add("Hello ") { $0.font = .systemFontOfSize(20) $0.color = .redColor() $0.underline = .St

A Simple Camera App With Programmatic UI
A Simple Camera App With Programmatic UI

CameraApp-ProgrammaticUI Hey there! This is a simple Camera Application that I and Sahab Alharbi worked on as part of Tuwaiq's iOS bootcamp projects.

A lightweight iOS mini framework that enables programmatic navigation with SwiftUI, by using UIKit under the hood.

RouteLinkKit A lightweight iOS mini framework that enables programmatic navigation with SwiftUI. RouteLinkKit is fully compatible with native Navigati

Swifty DSL for programmatic Auto Layout in iOS
Swifty DSL for programmatic Auto Layout in iOS

WWLayout Easy to write auto layout constraints, with minimal extensions to standard namespaces. Feature Highlights Easy to use, readable API Backwards

A ARM macOS Virtual Machine, using macOS 12's new Virtualization framework.
A ARM macOS Virtual Machine, using macOS 12's new Virtualization framework.

macOS Virtual Machine A ARM macOS Virtual Machine, using macOS 12's new Virtualization framework. I copied KhaosT's code from here, all I did is chang

macOS application written in SwiftUI that downloads installer pkgs for the Install macOS Big Sur application.
macOS application written in SwiftUI that downloads installer pkgs for the Install macOS Big Sur application.

Download Full Installer This is a Swift UI implementation of my fetch-installer-pkg script. It will list the full macOS Big Sur (and later) installer

"Podman for macOS" is a macOS frontend for Podman.

Podman for macOS "Podman for macOS" is a macOS frontend for Podman. It can be used to start and stop both the Podman Machine and its running container

Tool for running macOS guest virtual machines in macOS 12 host or higher on M1 arm64 Macs

macosvm macosvm is a command line tool which allows creating and running of virtual machines on macOS 12 (Monterey) using the new Virtualization frame

Varnam Input Method Engine for macOS. Easily type Indian languages on macOS

VarnamIME for macOS Easily type Indian languages on macOS using Varnam transliteration engine. Built at FOSSUnited's FOSSHack21. This project is a har

A dependency manager driven by SwiftPM that works for iOS/tvOS/watchOS/macOS projects.
A dependency manager driven by SwiftPM that works for iOS/tvOS/watchOS/macOS projects.

Installation • Usage • Supporting Accio • Contributing • License ⚠️ Deprecation Notice ⚠️ With the release of Xcode 12 which includes Swift 5.3, we fe

Comments
  • Retrocompatibility

    Retrocompatibility

    Hello,

    I'm mainly targeting older mac versions (as far as Marverick). Is there a way to make Element compatible with these ? If not what would be the oldest supported os, El Captain ?

    Thanks

    opened by melMass 15
  • Implementation

    Implementation

    Hey!

    First, great job guys - seems like A LOT of work has been put into it and it is definitely something that is sorely missing on OSX.

    Now, as for the issue - Element is currently missing description about how to implement it in the project itself - and it does not seem easy on the first look - is there possibility you could extend readme to have this described more properly?

    Also, have you thought about using CocoaPods? That would help immensely and definitely would allow more people to use the project.

    Thank you very much! Sincerely JT

    opened by JiriTrecak 4
  • Custom NSWindow Shadow

    Custom NSWindow Shadow

    I've searched everywhere on the net. Nothing.

    Electron has this so must be possible.

    Anyone have a clue about this?

    Potentially if this was ported to swift. it could be used: http://stackoverflow.com/questions/32210670/change-heaviness-of-nswindow-drop-shadow

    • Closing this for now. Figured out how to get regular shadow and not just "untitled" shadow
    opened by eonist 0
  • Library does not compile under swift 4

    Library does not compile under swift 4

    Output: https://pastebin.com/Ey1pDyVu

    main.swift:

    print("Hello, world!")
    
    

    Package.swift:

    import PackageDescription
    
    let package = Package(
        name: "PinSwift",
        dependencies: [
            .package(url: "https://github.com/eonist/Element.git", .branch("master"))
        ],
        targets: [
            .target(
                name: "PinSwift",
                dependencies: [
                    "Element",
                ],
                path: "Sources"
            ),
            .testTarget(
                name: "PinSwiftTests",
                dependencies: ["PinSwift"]),
        ]
    )
    

    AppDelegate.swift is empty

    If I'm importing the library wrong, please let me know. It doesn't work in Package.swift the way mentioned in README.md, so I've changed that

    opened by gastrodon 0
Releases(0.0.0-alpha.3)
Owner
André J
CTO @ sentry.co
André J
A Simple Camera App With Programmatic UI

CameraApp-ProgrammaticUI Hey there! This is a simple Camera Application that I and Sahab Alharbi worked on as part of Tuwaiq's iOS bootcamp projects.

null 0 Dec 4, 2021
Super awesome Swift minion for Core Data (iOS, macOS, tvOS)

⚠️ Since this repository is going to be archived soon, I suggest migrating to NSPersistentContainer instead (available since iOS 10). For other conven

Marko Tadić 306 Sep 23, 2022
Circular progress indicator for your macOS app

CircularProgress Circular progress indicator for your macOS app This package is used in production by apps like Gifski and HEIC Converter. Requirement

Sindre Sorhus 520 Jan 3, 2023
⚙ Add a preferences window to your macOS app in minutes

Preferences Add a preferences window to your macOS app in minutes Just pass in some view controllers and this package will take care of the rest. Requ

Sindre Sorhus 1.2k Jan 6, 2023
UIPheonix is a super easy, flexible, dynamic and highly scalable UI framework + concept for building reusable component/control-driven apps for macOS, iOS and tvOS

UIPheonix is a super easy, flexible, dynamic and highly scalable UI framework + concept for building reusable component/control-driven apps for macOS, iOS and tvOS

Mohsan Khan 29 Sep 9, 2022
High performance Swift treemap layout engine for iOS and macOS.

Synopsis YMTreeMap is a high performance treemap layout engine for iOS and macOS, written in Swift. The input to YMTreeMap is a list of arbitrary numb

Yahoo 118 Jan 3, 2023
A window arrangement manager for macOS like BetterSnapTool and Magnet

A window arrangement manager for macOS like BetterSnapTool and Magnet. You can split the foremost window to the left half of the screen, the left two-thirds, etc.

Takuto NAKAMURA (Kyome) 65 Dec 9, 2022
macOS GUI Library for the Nim Programming Language

NimCocoa NimCocoa is an experimental implementation of a Native GUI for the Nim programming language running on macOS. Rather than rely on low level c

null 32 Dec 8, 2022
SheetPresentation for SwiftUI. Multiple devices support: iOS, watchOS, tvOS, macOS, macCatalyst.

SheetPresentation for SwiftUI. Multiple devices support: iOS, watchOS, tvOS, macOS, macCatalyst.

Aben 13 Nov 17, 2021
Demonstration of LegoArtFilter for iOS/macOS

LegoArtFilterDemo Demonstration of LegoArtFilter for iOS/macOS. This project runs on both iOS (14≤) and macOS (11≤). Libraries LegoColors LegoArtFilte

Takuto NAKAMURA (Kyome) 1 Oct 16, 2021