Skip to content
(Work in Progress) Lightweight Declarative Wrapper for UIKit
Swift Ruby Objective-C
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
DeclarativeKit.xcodeproj
DeclarativeKit
DeclarativeKitTests
docs
.gitignore
.jazzy.yaml
.slather.yml
.travis.yml
DeclarativeKit.podspec
LICENSE
README.md

README.md

[WIP] declarative-kit

Build Status codecov Cocoapods Contact

Declarative Kit is a lightweight declarative wrapper on top UIKit. As SwiftUI has announced by apple at WWDC 19 which introducing this declarative way to code, I think it will not that bad to adapt this declarative way of programming to UIKit.

Several Advantage to use more Declarative Programming:

  • High Readability
  • Minimize Mutability
  • Composeable Code

Example

   let button = UIButton
      .init()
      .title("Button")
      .accessibilityIdentifier("detailButton")
      .backgroundColor(.black)
      .cornerRadius(13)
      // assign tap action
      .tap { _ in
         print("button was tapped")
      }
      .addToView(rootView) // add this button to rootView

TODO

  • Fill More UIKit Compose Declarative
  • Declarative Way to use Auto Layout
  • Evolution (SwiftUI without iOS 13, etc)
  • Robust Unit Testing
  • More Example

Instalation

Cocoapods

   pod 'DeclarativeKit'

Carthage

Coming Soon

Swift Package Manager

Coming Soon

Contribution

Declarative Kit is welcome for contribution, feel free to suggest any idea, or create PR and issues.

You can’t perform that action at this time.