Skip to content

This app is for animating a car like uber from one position to another with preserving angle and smooth animation

Notifications You must be signed in to change notification settings

SURYAKANTSHARMA/UberCarAnimation

Repository files navigation

Travis CI

UberAnimation

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.

Features

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.

Requirements

  • Xcode 16+
  • Swift 6+

Usage

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 screen shot 2019-02-11 at 6 08 12 pm

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
Unable to load gif

With Apple MapKit new swift APIs

  • used MKDirections APIs for Polyline

|Unable to load gif|

Pause and play

  1. Simulate the location on the simulator
  2. Press the pause button to pause car animation and play to resume the animation

Contributing

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.

License

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.

Video Tutorial

Youtube video on extracting this repo code for own use