TStyle - A simple and flexible UI component fully written in Swift
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
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
- 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)
- For button:
let exampleButton = UIButton()
TStyle<UIButton>()
.font(.systemFont(ofSize: 16))
.title("Example Button")
.roundedCorners()
.accessibilityIdentifier("button.example")
.apply(to: exampleButton)
- For image view:
let exampleImageView = UIImageView()
TStyle<UIImageView>()
.image(UIImage(named: "")!)
.roundedCorners()
.accessibilityIdentifier("image.example")
.apply(to: exampleImageView)
- 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, thinhnguyen12389@gmail.com
License
TStyle is available under the MIT license. See the LICENSE file for more info.