Description
This helps make the view's configuration code, hierarchy code, and constraint code neat.
UIBaseKit alternatives and similar libraries
Based on the "Code Quality" category.
Alternatively, view UIBaseKit alternatives based on common mentions on social networks and blogs.
-
chisel
Chisel is a collection of LLDB commands to assist debugging iOS apps. -
SwiftFormat
A command-line tool and Xcode Extension for formatting Swift code -
MLeaksFinder
Find memory leaks in your iOS app at develop time. -
FBRetainCycleDetector
iOS library to help detecting retain cycles in runtime. -
FBMemoryProfiler
iOS tool that helps with profiling iOS Memory usage. -
CleanArchitectureRxSwift
Example of Clean Architecture of iOS app using RxSwift -
OCLint
A static source code analysis tool to improve quality and reduce defects for C, C++ and Objective-C -
Dotzu
iOS app debugger while using the app. Crash report, logs, network. -
HeapInspector-for-iOS
Find memory issues & leaks in your iOS app without instruments -
dotenv-linter
⚡️Lightning-fast linter for .env files. Written in Rust 🦀 -
spacecommander
Commit fully-formatted Objective-C as a team without even trying. -
IBAnalyzer
Find common xib and storyboard-related problems without running your app or writing unit tests. -
ODUIThreadGuard
A guard to help you check if you make UI changes not in main thread -
DWURecyclingAlert
Optimizing UITableViewCell For Fast Scrolling -
SwiftCop
SwiftCop is a validation library fully written in Swift and inspired by the clarity of Ruby On Rails Active Record validations. -
Warnings-xcconfig
An xcconfig (Xcode configuration) file for easily turning on a boatload of warnings in your project or its targets. -
Marshroute
Marshroute is an iOS Library for making your Routers simple but extremely powerful -
PSTModernizer
Makes it easier to support older versions of iOS by fixing things and adding missing methods -
Trackable
Trackable is a simple analytics integration helper library. It’s especially designed for easy and comfortable integration with existing projects. -
DecouplingKit
decoupling between modules in your iOS Project. iOS模块化过程中模块间解耦方案 -
AnyLint
Lint anything by combining the power of scripts & regular expressions. -
WeakableSelf
A Swift micro-framework to easily deal with weak references to self inside closures -
SwiftLinter
Share lint rules between projects and lint changed files with SwiftLint. -
Bugsee
In-app bug and crash reporting with video, logs, network traffic and traces.
Appwrite - The open-source backend cloud platform
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of UIBaseKit or a related project?
README
UIBaseKit
🤔So far, when coding for a view, we wrote a combination of configuration code, constraint code, and hierarchical code, resulting in a poor understanding of the source. So, I created a library that helps you separate this configuration code, constraint code, and hierarchical code to make it cleaner.
Usage
QuickStart
After inheriting from BaseViewController
, override and implement the setupViews
and setupConstraints
methods.
import UIKit
import UIBaseKit
class SignUpViewController: BaseViewController {
// MARK: - UI
var usernameLabel: UILabel = {
$0.textColor = .black
$0.textAlignment = .right
$0.font = .boldSystemFont(ofSize: 16.0)
$0.text = "Username"
return $0
}(UILabel())
...
var emailLabel: UILabel = {
$0.textColor = .black
$0.textAlignment = .right
$0.font = .boldSystemFont(ofSize: 16.0)
$0.text = "Email"
return $0
}(UILabel())
...
/// After configure propertys for each view,
/// return an array of views to add to the superview in desired order.
override func setupViews() -> [CanBeSubview]? {
// 1) configure views
view.backgroundColor = .white
registerKeyboardObservers()
signUpButton.addTarget(self, action: #selector(signUpButtonDidTouch), for: .touchUpInside)
...
// 2) return subviews
/** 😍 viewController`s view hierarchy
→ keyboardAvoidView
→ containerView
→ usernameLabel
→ usernameTextField
→ emailLabel
→ emailTextField
→ passwordLabel
→ passwordTextField
→ signUpButton
*/
let hierarchy = [
keyboardAvoidView.addSubviews(
containerView.addSubviews(
usernameLabel,
usernameTextField,
emailLabel,
emailTextField,
passwordLabel,
passwordTextField
)
),
signUpButton
]
return hierarchy
}
/// Configure the constraints for each view.
override func setupConstraints() {
// 3) set constraints for each view added to superview.
// 🤓Note: I set constraints for each view using my favorite `FluidAnchor` library.
// https://github.com/audrl1010/FluidAnchor
keyboardAvoidView.flu
.leftAnchor(equalTo: view.leftAnchor)
.topAnchor(equalTo: view.topAnchor)
.rightAnchor(equalTo: view.rightAnchor)
.bottomAnchor(equalTo: view.bottomAnchor)
containerView.flu
.topAnchor(equalTo: view.topAnchor, constant: 60)
.leftAnchor(equalTo: view.leftAnchor, constant: 15)
.rightAnchor(equalTo: view.rightAnchor, constant: -15)
.heightAnchor(equalToConstant: 180)
...
}
}
Support Classes
class BaseView: UIView { ... }
class BaseTableViewCell: UITableViewCell { ... }
class BaseCollectionViewCell: UICollectionViewCell { ... }
class BaseViewController: UIViewController { ... }
Installation
pod 'UIBaseKit'
Author
Myung gi son, [email protected]
License
UIBaseKit is available under the MIT license. See the LICENSE file for more info.
*Note that all licence references and agreements mentioned in the UIBaseKit README section above
are relevant to that project's source code only.