Belt is a utility library designed to simplify repetitive and tedious tasks in iOS development, often referred to as "grunt work" by developers. Like grabbing a tool from a utility belt, Belt helps handle common tasks such as photo album access, file management, location services, and permissions handling, offering easy-to-use abstractions.
Belt supports fast prototyping and enables developers to avoid the monotony of repetitive coding, allowing them to focus on more creative and important aspects of development. It ensures fast development speed while providing simple, reusable solutions.
Arm yourself for battle with Belt, the essential tool for every grunt worker.
Junior developers are encouraged to contribute to the Belt framework by participating in the development of example pages. This is a great opportunity to enhance your skills while contributing to the project.
Belt includes several handy utilities and kits:
- Manage media files like photos and videos.
- Fetch, create, and delete albums in the photo library.
- Manage files and directories effortlessly.
- Easily read, write, delete files, and create directories.
- Handle GPS and location-based services.
- Retrieve the current location, track real-time positions, and handle location permissions.
- Manage app permissions for camera, location, notifications, etc.
- Request, check status, and determine if permissions are granted.
- Manage local and push notifications.
- Set up notifications and handle both local and push notifications seamlessly.
- Easily store and retrieve data using
UserDefaults. - Manage user settings efficiently.
- Store and retrieve secure data like passwords or tokens using the Keychain.
- Discover, connect, and manage Bluetooth devices.
- Simplifies working with Core Data, including creating, saving, fetching, and deleting data.
- Handle audio playback and recording with ease.
- Quickly apply common animations to your UI elements.
- Simplifies making HTTP requests and handling responses for both GET and POST operations.
- Monitor network connection status and automatically handle network availability changes.
- Retrieve basic device information such as OS version, model, and screen resolution.
- Manage data on the clipboard, including copying and pasting text or images.
Utility classes should be stateless, meaning they don't retain any state and are purely functional. This ensures predictable outcomes and simplifies testing.
Ensure utility classes are easy to test by minimizing external dependencies. If dependencies are required, use dependency injection to reduce tight coupling and improve testability.
You can easily add Belt to your project using the Swift Package Manager:
dependencies: [
.package(url: "https://github.com/realsilex/Belt.git", from: "1.0.0")
]Belt is designed to be simple and intuitive. Each utility and kit can be quickly integrated into your project. Below are a few common usage scenarios:
- AssetUtility: Access and manage photo albums, and retrieve photos and videos.
- LocationUtility: Fetch current location and track real-time position updates.
- UserDefaultsUtility: Easily store and retrieve simple key-value data.
- HapticFeedbackUtility: Trigger various types of haptic feedback.
- NotificationUtility: Create and manage local and push notifications.
Each utility is designed with a straightforward API for easy integration into your project.
If you encounter bugs or have improvement suggestions, feel free to report them via the issue tracker. We also welcome feature requests and general feedback.
Belt is licensed under the MIT License. You are free to use, modify, and distribute this library, as long as you include the license file in your distribution.
If you find this project helpful, please give it a ⭐️ and contribute to its improvement through pull requests and issue reporting!
If you have any questions or need further assistance, feel free to contact us at realsilex@gmail.com.
