OpenTripPlanner library for iOS, written in Swift. OTPKit is a reusable library that powers trip planning in the OneBusAway iOS app and can be integrated into any iOS application.
- Compatible with iOS 17+
- Works with OpenTripPlanner 1.5.x and higher
- Licensed under Apache 2.0
- Provides networking, models, and APIs for building a complete trip planning experience
Add OTPKit to your iOS project using Swift Package Manager:
dependencies: [
.package(url: "https://github.com/OneBusAway/OTPKit.git", from: "1.0.0")
]
import OTPKit
struct ContentView: View {
var body: some View {
// 1. Configure OTPKit with server URL and theme
let config = OTPConfiguration(
otpServerURL: URL(string: "https://your-otp-server.com")!,
region: .userLocation(fallback: .automatic),
themeConfiguration: OTPThemeConfiguration(primaryColor: .blue, secondaryColor: .gray)
)
// 2. Create API service for OpenTripPlanner
let apiService = RestAPIService(baseURL: config.otpServerURL)
VStack {
// 3. Add complete trip planner to your app
OTPView(otpConfig: config, apiService: apiService)
}
}
}
import OTPKit
let config = OTPConfiguration(
otpServerURL: URL(string: "https://your-otp-server.com")!,
region: .userLocation(fallback: .automatic)
)
let apiService = RestAPIService(baseURL: config.otpServerURL)
let tripPlannerView = OTPView(otpConfig: config, apiService: apiService)
// Embed in UIKit using UIHostingController
let hostingController = UIHostingController(rootView: tripPlannerView)
addChild(hostingController)
view.addSubview(hostingController.view)
OTPKit uses SwiftLint to enforce consistent code style and Swift best practices. Install it locally using Homebrew:
brew install swiftlint
This project was developed as part of Google Summer of Code 2025, created by Manu Rajbhar with guidance from Aaron Brethorst.
You can read the full final report here: GSoC 2025 Final Report – OTPKit
Licensed under Apache 2.0. See LICENSE for more details.
OTPKit was originally created as a Google Summer of Code project.
- Aaron Brethorst
- Manu R - GSoC 2025 contributor
- Hilmy Veradin - GSoC 2024 contributor