BaseUIKit
No description available
Install / Use
/learn @JinUng41/BaseUIKitREADME
BaseUIKit
BaseUIKit is a UIKit-based library that helps reduce repetitive code and maintain consistent coding styles across your project.
How To Use
- Override the
setup~methods provided by the Base classes to implement the necessary configurations. - When overriding, you do not need to call the superclass method.
Example: Overriding Methods
import BaseUIKit
class MyViewController: BaseViewController {
override func setupView() {
// Configure the view
}
override func setupConstraints() {
// Set up constraints
}
}
Example: Registering and Using a Cell in a CollectionView
import BaseUIKit
class MyCollectionViewCell: BaseCollectionViewCell {
override func setupView() {
// Initial UI setup for the cell
}
override func setupConstraints() {
// Set up layout constraints
}
}
// Register the cell in the CollectionView
collectionView.register(MyCollectionViewCell.self, forCellWithReuseIdentifier: MyCollectionViewCell.identifier)
// Dequeue and use the cell in the CollectionView
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: MyCollectionViewCell.identifier, for: indexPath) as! MyCollectionViewCell
// Configure the cell
return cell
}
Available Methods by Class
BaseViewController
setupViewsetupConstraintssetupActionsetupDelegatesetupBinding
BaseView, BaseCollectionViewCell, BaseCollectionReusableView, BaseTableViewCell
setupViewsetupConstraintssetupAction
Contact
- If you have any questions, please contact us at ‘devjinung41@gmail.com’.
