Lux

master

Open UI Look development framework for SwiftUI, iOS + macOS
maxwelldesign/lux

MAXWELL L U X makes app development faster (and magic)! Craft customized UI Design Systems ready to be used in SwiftUI—even if you’re not a design expert!

⚠️ To use with Swift 5.x. Please ensure you are using >= 5.1.0 ⚠️

Contents

Requirements

  • iOS 13.1+ / Mac OS X 10.15+
  • Xcode 11.3+
  • Swift 5.1+

Communication

  • If you need help, use Discord. (Tag 'lux')
  • If you'd like to ask a general question, use Stack Overflow.
  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Installation

SPM

Swift Package Manager is a dependency manager for Cocoa projects.

You can install Lux by importing this repo's url into Xcode.

https://github.com/maxwelldesign/lux

CocoaPods

Notice: There are some known issues with CocoaPods and Xcode-Canvas. Whenever possible, please prefer the SPM install option. Experimental LUX import as SPM package inside a CocoaPods project has been successful.

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1.0+ is required to build Lux 1.0.0+.

To integrate Lux into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'Lux', '~> 1.0.0'
end

Then, run the following command:

$ pod install

Usage

Quick Start

import SwiftUI
import Lux

struct ContentView: View {

    var body: some View{
      Column{
        Row{
          Text("Hello World")
          .lux
          .trait(.title)
          .style(.paragraph)
          .view
        }
      }
      .lux
      .style(.panel)
      .feature(.padding, .shadow,)
      .card
      .view
    }

}

Specification

Install the Maxwell App to create LUX specifications. It's available for iOS and macOS from the MAXWELL DESIGN website:

From the Maxwell App:

  • From the Home select the LUX tab
  • Tap on a look to enter the editor
  • Tap on the paperplane icon
  • At the bottom of the action sheet locate the "options"
  • Tap the options button
  • Select "Init Config"

Note: If you are in the simulator, use "Get Pasteboard" from the menu to transmit the data to macOS.

Once ready, open Xcode and paste the configuration code BEFORE attaching your views, ideally in the Scene Delegate, ie:

 func initializeLook(){
        do{
            try Look.set(data64:" SOME DATA")
        }catch{
            print("error")
        }
  }

Stream

You can tweak any LUX powered application in realtime from the MAXWELL APP.

Add this to your launch code:

 func tuneLux(){
        Look.tunning()
  }

Then to dynamically update any view simple add this Observable definition for the global Look state:

struct ContentView: View {
    @ObservedObject var state = Look.state
    ...

Note: You can name it in any way.

Playground

You can try Lux in Playground.

Note:

To try Lux in playground, open Lux.xcworkspace and build Lux.framework for any simulator first.


Resources

Learning

Install the Maxwell App and purchase a research license to its Full Source Code. Some interesting features:

  • All screens based in LUX DSL
  • Firebase integration
  • iOS + macCatalyst
  • Sign in with Apple
  • Push Notifications
  • Local Storage
  • Realtime Databse
  • Remote Configuration
  • In-App Purchases
  • Web Browsers
  • Advanced Combine + SwiftUI
  • way more!

The entire Maxwell App is based on a (flavored) MVVC pattern over Combine + SwiftUI. Don't miss the chance to look into one of the first large scale apps built on the SwiftUI era!

Credits

License

LUX is released under the GNU GPL license. See LICENSE for details.

Contact lux@maxwell.design for flexible licensing options and other inqueries.

Description

  • Swift Tools 5.1.0
View More Packages from this Author

Dependencies

  • None
Last updated: Fri Oct 18 2024 21:02:08 GMT-0900 (Hawaii-Aleutian Daylight Time)