LOGO

TStyle

TStyle is a simple and flexible UI component fully written in Swift. TStyle is developed to help users quickly define attributes detail without having to define from scratch

Swift 5.0 Version License Platform

Example

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

Requirements

Installation

TStyle is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'TStyle'

Usage

import TStyle
  1. For label:

let exampleLabel = UILabel()

TStyle<UILabel>()
.multiline()
.textColor(.black)
.textAlignment(.left)
.font(.systemFont(ofSize: 16))
.accessibilityIdentifier("label.example")
.text("Example Label")
.apply(to: exampleLabel)
  1. For button:

let exampleButton = UIButton()
TStyle<UIButton>()
.font(.systemFont(ofSize: 16))
.title("Example Button")
.roundedCorners()
.accessibilityIdentifier("button.example")
.apply(to: exampleButton)
  1. For image view:

let exampleImageView = UIImageView()
TStyle<UIImageView>()
.image(UIImage(named: "")!)
.roundedCorners()
.accessibilityIdentifier("image.example")
.apply(to: exampleImageView)
  1. For view:

let exampleView = UIView()
TStyle<UIView>()
.roundedCorners()
.backgroundColor(.black)
.accessibilityIdentifier("view.example")
.apply(to: exampleView)

Requirements

  • iOS 11.0 or later
  • Swift 5.0 or later

Author

fanta1ty, [email protected]

License

TStyle is available under the MIT license. See the LICENSE file for more info.

GitHub

View Github