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
To run the example project, clone the repo, and run pod install
from the Example directory first.
TStyle
is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod 'TStyle'
Second, install TProgressHUD
into your project:
pod install
TProgressHUD
is designed for Swift 5. To depend on the logging API package, you need to declare your dependency in your Package.swift
.package(url: "https://github.com/fanta1ty/TStyle.git", brand: "master"),
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)
- iOS 11.0 or later
- Swift 5.0 or later
fanta1ty, [email protected]
TStyle is available under the MIT license. See the LICENSE file for more info.