UberCarAnimation is a delightful and interactive iOS library that provides a smooth and realistic animation of a car moving along a route, inspired by the Uber app's ride tracking feature. This library allows you to easily integrate this dynamic animation into your own iOS app to enhance the user experience.
Realistic animation: The library offers a lifelike animation of a car moving along a specified route, complete with smooth transitions and interactive elements. Customizable appearance: Developers can customize various aspects of the animation, including the car image, route color, and animation speed, to match their app's visual style. Simple integration: With a few lines of code, you can seamlessly integrate the UberCarAnimation into your iOS app, saving time and effort in development.
- Added Sample project for both UIKit and SwiftUI with Google Maps
- MapKit with SwiftUI Integration: Demonstrates integrating MapKit directly in SwiftUI, adding annotations and polylines to represent routes dynamically.
- Xcode 16
- Swift 6
With Google Maps
Replace ADD_YOUR_GOOGLE_API_KEY
in class AppDelegate.swift
from your actual google api key from Here
Once you have your app running in the simulator, select simulate locations in Xcode as follows
You will see nice moving car with uber like animation like below
Note: We are using the static path string for giving driving road location from A to B. For actual path use Google's direction api Here
Light Mode | Dark Mode |
---|---|
With Apple MapKit new swift APIs
- used MKDirections APIs for Polyline
Pause and play
- Simulate the location on the simulator
- Press the pause button to pause car animation and play to resume the animation
Contributions to UberCarAnimation are welcome! If you encounter any issues or have ideas for improvements, please open an issue or submit a pull request on GitHub.
UberCarAnimation is available under the MIT license. See the LICENSE file for more information.
Stay Connected Follow SURYAKANTSHARMA on GitHub for the latest updates and releases.
Youtube video on extracting this repo code for own use