A Swift package that provides a collection of useful extensions and utilities for iOS
SwiftyKit
SwiftyKit is a Swift package that provides a collection of useful extensions and utilities for iOS app development. It includes extensions for UIKit classes like UIView, UILabel, UIButton, and more, as well as some useful utility functions.
Installation
To install SwiftyKit in your project, simply add the following line to your Package.swift file:
dependencies: [
.package(url: "https://github.com/your_username/SwiftyKit.git", from: "1.0.0")
]
Then import the module in the files you want to use it in:
import SwiftyKit
Example Usage
final class ExampleView: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.title = "Navigation Title"
self.navigationController?.navigationBar.prefersLargeTitles = true
createView()
}
func createView() {
BaseScrollView {
VerticalStack {
for number in 0...10 {
HorizontalStack {
UILabel("Key: \(number)")
Spacer()
UILabel("Value")
}.padding()
.backgroundColor(.systemBackground)
.cornerRadius(10)
.shadow()
}
}.spacing(15)
.padding()
}.addView(view)
.fillToSuperView()
}
}
Content
-
UIView
-
Spacer
-
func addView(_ ?
-
func padding(_ ?
-
func widthToSuperview(_ ?
-
func width(_ ?
-
func height(_ ?
-
func heightToSuperview(_ ?
-
func frame(_ ?
-
func center(_ ?
-
func centerToSuperview(_ ?
-
func centerHorizontal(_ ?
-
func centerHorizontalToSuperview(_ ?
-
func centerVertical(_ ?
-
func centerVerticalToSuperview(_ ?
-
func pin(_ ?
-
func pinToSuperview(_ ?
-
func fill(_ ?
-
func fillToSuperView(_ ?
-
func shadow(_ ?
-
func stroke(_ ?
-
func cornerRadius(_ ?
-
func contentMode(_ ?
-
func tintColor(_ ?
-
func backgroundColor(_ ?
-
func clipsToBounds(_ ?
-
func transform(_ ?
-
-
UITextField
-
BaseTextField
-
func text(_ ?
-
func attributedText(_ ?
-
func placeholder(_ ?
-
func attributedPlaceholder(_ ?
-
func textColor(_ ?
-
func textAlignment(_ ?
-
func font(_ ?
-
func borderStyle(_ ?
-
func adjustsFontSizeToFitWidth(_ ?
-
func minimumFontSize(_ ?
-
func background(_ ?
-
func disabledBackground(_ ?
-
func leftView(_ ?
-
func leftViewMode(_ ?
-
func rightView(_ ?
-
func rightViewMode(_ ?
-
func inputView(_ ?
-
func inputAccessoryView(_ ?
-
func clearsOnInsertion(_ ?
-
func clearsOnBeginEditing(_ ?
-
-
UIStackView
-
UILabel
-
UIImageView
-
UIButton
-
UISwitch
-
BaseScrollView
Helpers & Utils
Contributing
If you find a bug or have a feature request, please open an issue on the GitHub repository. Pull requests are also welcome. Also you can check here.
License
SwiftyKit is released under the Apache License. See LICENSE for more information.