mahinmuhammad/checkboxswiftui
CheckBox-SwiftUI is a custom checkbox package for SwiftUI. It provides a simple and customizable checkbox view
Preview
[preview of checkbox]
Requirements
- iOS 13.0+
- Xcode 11.2+
- Swift 5.0
- SwiftUI framework
Features
- Customizable checkbox view for SwiftUI.
- Uses SF Symbols for checkbox states.
- Supports toggling the checkbox state.
- Optional customization of checkbox color and title color.
Installation
Swift Package Manager
You can add CheckBox-SwiftUI as a dependency in your Swift Package Manager-enabled project. Follow these steps to integrate the package into your project:
- In Xcode, go to "File" -> "Add Packages...".
- Enter the URL of this repository: https://github.com/MahinMuhammad/CheckBoxSwiftUI
- Choose the desired version rule.
- Chosse the target where you want to add the package.
- Click "Add Package".
- Wait till Xcode varify and fetch it for you.
- Click "Add Package".
Usage
To use CheckBox-SwiftUI in your SwiftUI project, follow these steps:
- Import the CheckBoxSwiftUI module:
import CheckBoxSwiftUI- Create a @State property to hold the checkbox state:
@State private var isChecked = false- Use the 'CheckBox' view in your SwiftUI view hierarchy:
CheckBox(isChecked: $isChecked, title: "Click on this checkbox")- Customize the checkbox appearance by providing optional parameters:
CheckBox(isChecked: $isChecked, title: "Checkbox", checkBoxColor: .blue, titleColor: .black)Integration into a complete but simple code:
import SwiftUI
import CheckBoxSwiftUI
struct ContentView: View {
@State private var isChecked = false
var body: some View {
VStack {
CheckBox(isChecked: $isChecked, title: "Click on this checkbox")
}
.padding()
}
}
Find Me on:
Contributing
Contributions to CheckBox-SwiftUI are welcome! If you encounter any issues or have ideas for improvements, please feel free to open an issue or submit a pull request.
Feedback
Please feel free to open any issue
License
CheckBox-SwiftUI is available under the MIT License. See the LICENSE file for more information.
Package Metadata
Repository: mahinmuhammad/checkboxswiftui
Default branch: master
README: README.md