A beautiful and interactive visualization tool for common sorting algorithms built with SwiftUI. Watch how different sorting algorithms work in real-time with customizable animations and settings.
-
Multiple Sorting Algorithms:
- Bubble Sort
- Selection Sort
- Insertion Sort
- Merge Sort (Traditional)
- Merge Sort (Parallel)
- Quick Sort
-
Interactive Visualization:
- Real-time visualization of sorting process
- Color-coded elements to track comparisons
- Adjustable animation speed
- Show/hide element values
- Performance timer
-
Cross-Platform Support:
- iOS
- iPadOS
- macOS
- visionOS
- iOS 18.0+
- macOS 15.0+
- visionOS 2.0+
- Xcode 16+
- Swift 6.0+
- Clone the repository:
git clone https://github.com/pitt500/SortingApp.git-
Open
SortingApp.xcodeprojin Xcode -
Build and run the project
- Select a sorting algorithm from the top menu
- Click "Sort" to start the visualization
- Use "Reset" to generate a new random array
- Click "Cancel" to stop the current sorting process
You can customize the visualization through the settings:
- Enable/Disable Animations: Toggle sorting animations
- Show/Hide Bar Values: Display numerical values above each bar
- Animation Speed: Adjust the speed of the sorting animation
- Show/Hide Timer: Display sorting duration
The project follows a clean SwiftUI architecture:
- SortingAlgorithm: Core logic for sorting implementations
- SortingView: Main view controller and UI
- SortingChartView: Custom visualization using SwiftUI Charts
- Settings: User preferences and configuration
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Pedro Rojas (Pitt) - @swiftandtips
This project is licensed under the MIT License - see the LICENSE.md file for details
- SwiftUI Charts for the visualization components
- Apple's Swift and SwiftUI frameworks
- The Swift community for continuous inspiration

