Skip to content

This is a small but handy library that extends UIKit in a functional manner

License

Notifications You must be signed in to change notification settings

keylook/with-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alt text

This is a small but handy library that extends UIKit in a functional manner. Inspired by SwiftUI and declarative paradigm.

Example usage for UILabel

let label = UILabel()
  .withTextColor(.black)
  .withFont(.systemFontOfSize(14))
  .withText("My Label")
  .withTextAlignment(.center)

Example for WKButton and .withTapBlock

lazy var myButton = WKButton
    .withBackgroundColor(UIColor.white)
    .withTitleColor(UIColor.black)
    .withTitle("My Button, for: .normal)
    .withCornerRadius(18)
    .withImage(Assets.myButtonIcon, for: .normal)
    .withImage(Assets.myDisabledButtonIcon, for: .disabled)
    .withTapBlock(handleButtonTap)
    
func handleButtonTap() {
  // do something
}

Example for UITextField

let emailTextField = UITextField()
  .withPlaceholder("Email")
  .withKeyboard(.emailAddress)
  .withAutoCorrect(.no)
  .withAutoCapitalization(.none)

let passwordField = UITextField()
  .withPlaceholder("Password")
  .withAutoCorrect(.no)
  .withAutoCapitalization(.none)
  .withSecureTextEntry(true)
  

Installation

Drop sources folder in your project. More installation options are coming.

This library is work in progress. Version 0.2.0

About

This is a small but handy library that extends UIKit in a functional manner

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages