Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mor4eza/bouncyslider
πiOS Control Center Volume Slider implemention in SwiftUI
https://github.com/mor4eza/bouncyslider
bouncy library slider spm swift swiftui xcode
Last synced: 2 days ago
JSON representation
πiOS Control Center Volume Slider implemention in SwiftUI
- Host: GitHub
- URL: https://github.com/mor4eza/bouncyslider
- Owner: Mor4eza
- Created: 2024-11-12T12:59:35.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-13T12:52:10.000Z (2 months ago)
- Last Synced: 2024-12-25T16:02:03.613Z (about 1 month ago)
- Topics: bouncy, library, slider, spm, swift, swiftui, xcode
- Language: Swift
- Homepage:
- Size: 174 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BouncySlider
[![Platform](https://img.shields.io/badge/platform-iOS-lightgrey.svg)](https://developer.apple.com/ios/)
[![Swift](https://img.shields.io/badge/Swift-5.0-orange.svg)](https://swift.org/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)**BouncySlider** is a customizable and interactive SwiftUI slider with a delightful bouncy animation. Perfect for adding a fun, engaging slider component to your iOS apps.
## Features
- π Smooth and bouncy animation for enhanced user experience.
- π¨ customizable appearance (color, image, size).
- π± Compatible with SwiftUI and supports iOS.## Preview
## Installation
You can add BouncySlider to your project using Swift Package Manager:
1. Open your project in Xcode.
2. Go to **File > Add Package Dependency...**
3. Enter the following URL:
4. https://github.com/Mor4eza/BouncySlider.git
5. Select the version youβd like to use, or leave it as the default, and click **Next**.## Usage
### Basic Usage
To use **BouncySlider** in your SwiftUI view:
```swift
import SwiftUI
import BouncySliderstruct ContentView: View {
@State var value: CGFloat = 0.5
var body: some View {
VStack {
BouncySlider(value: $value, orientation: .vertical) {
if value == 1.0 {
Image(systemName: "speaker.wave.3.fill").foregroundStyle(.gray)
} else if value < 1.0 && value > 0.36 {
Image(systemName: "speaker.wave.2.fill").foregroundStyle(.gray)
} else if value <= 0.35 && value > 0.0 {
Image(systemName: "speaker.wave.1.fill").foregroundStyle(.gray)
} else {
Image(systemName: "speaker.fill").foregroundStyle(.gray)
}
}
Text("Volume: \(Int(value * 100))%")
}
}
}
```### Customization
You can customize various properties of the slider to fit your design needs:
- **Background Color**: Set the color of the slider Background.
- **Fill Color**: Set the color of the Slider.
- **Custom Image**: Add Custom Image to Slider.
- **Orientation**: Set the Slider Orientation to Vertical or Horizontal.
- **Slider length**: Change the length of the slider.Example:
```swift
BouncySlider(value: $value, orientation: .vertical, backgroundColor: .red, fillColor: .yellow) {
Image() // use your desired image
}
```## Example
To see **BouncySlider** in action, check out the included example project in the repository.
1. Clone the repository:
```bash
git clone https://github.com/Mor4eza/BouncySlider.git
```
2. Open BouncySliderExample.xcodeproj in Xcode.3. Build and run the project in the simulator or on a device.
This example demonstrates the basic and advanced uses of BouncySlider and lets you experiment with different customization options.
## Requirements
- iOS 14.0+
- Swift 5.0+
- SwiftUI## License
BouncySlider is available under the MIT license. See the [LICENSE](LICENSE) file for more information.
## Contributing
Contributions are welcome! If you have ideas for new features, improvements, or find any bugs, feel free to open an issue or submit a pull request. Please ensure that your contributions align with the existing code style and provide appropriate documentation.