Swiftpack.co - Package -

[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

Support Swift Package Manager, just add to your project from your Xcode 11.

Use this link on your Xcode Swift Package manager.

https://github.com/wendyliga/declarative-kit

make sure to use version 0.0.5 or newer.

Contribution

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

Github

link
Stars:
Help us keep the lights on

Dependencies

Used By

Total: 0