Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.
/ KarrotFlex Public archive

Declarative iOS UI sugar framework built on FlexLayout

License

Notifications You must be signed in to change notification settings

daangn/KarrotFlex

Repository files navigation

KarrotFlex

CI Status Version License Platform CI

Declarative UI sugar framework built on FlexLayout
👨‍🔧 Beware, Under construction 🧑‍🔧

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

self.someView.flex.define {
  FlexHStack($0) {
    FlexSpacer($0, spacing: 24.0)
    FlexVStack($0) {
      FlexItem($0, view: self.titleLabel)
      FlexSpacer($0, spacing: 8.0)
      FlexItem($0, view: self.descLabel)
      FlexSpacer($0, spacing: 24.0)
      FlexItem($0, view: self.infoLabel)
    }
  }
  .padding(16.0)
}

Requirements

Installation

CocoaPods

pod 'KarrotFlex'

Swift Package Manager

In your Package.swift:

let package = Package(
  name: "Example",
  dependencies: [
    .package(url: "https://github.com/daangn/KarrotFlex.git", from: "1.1.0")
  ],
  targets: [
    .target(name: "Example", dependencies: ["KarrotFlex"])
  ]
)

In your Xcode target:

Add FLEXLAYOUT_SWIFT_PACKAGE=1 to the build setting.
(TARGET -> Build Settings -> Apple Clang - Preprocessing -> Preprocessor Macros)

Author

License

The KarrotFlex is available for free use, as described by the LICENSE (Apache 2.0).