测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可 | MIT |
发布最新发布 | 2017年4月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 Genady Okrain 维护。
请注册并查看: https://developer.lyft.com
Lyft 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile
pod "Lyft"
Lyft.set(clientId: "clientId", clientSecret: "clientSecret")
为了测试请使用沙盒模式
Lyft.set(clientId: "clientId", clientSecret: "clientSecret", sandbox: true)
Lyft.openLyftRide(rideType: .Line, destination: Address(lat: 37.7763592, lng: -122.4242038))
别忘了更新 Info.plist 以支持 lyft://
Lyft.publicLogin { success, error in
}
Lyft.userLogin(scope: "public") { success, error in
}
您还需要设置重定向
func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
return Lyft.openURL(url)
}
Lyft.requestRideTypes(rideTypesQuery: RideTypesQuery(lat: 37.7833, lng: -122.4167)) { result, response, error in
}
Lyft.requestETA(etaQuery: ETAQuery(lat: 37.7833, lng: -122.4167)) { result, response, error in
}
Lyft.requestCost(costQuery: CostQuery(startLat: 37.7833, startLng: -122.4167, endLat: 37.7972, endLng: -122.4533)) { result, response, error in
}
Lyft.requestNearbyDrivers(nearbyDriversQuery: NearbyDriversQuery(lat: 37.7789, lng: -122.45690)) { result, response, error in
}
Lyft.requestRide(requestRideQuery: RequestRideQuery(originLat: 34.305658, originLng: -118.8893667, originAddress: "123 Main St, Anytown, CA", destinationLat: 36.9442175, destinationLng: -123.8679133, destinationAddress: "123 Main St, Anytown, CA", rideType: .Lyft)) { result, response, error in
}
Lyft.requestRideDetails(rideId: "123456789") { result, response, error in
}
Lyft.cancelRide(rideId: "123456789") { result, response, error in
}
Lyft.rateAndTipRide(rideId: "123456789", rateAndTipQuery: RateAndTipQuery(rating: 5, tipAmount: 100, tipCurrency: "USA", feedback: "great ride!") { result, response, error in
}
Lyft.requestRideReceipt(rideId: "123456789") { result, response, error in
}
Lyft.requestRidesHistory(ridesHistoryQuery: RidesHistoryQuery(startTime: "2015-12-01T21:04:22Z", endTime: "2015-12-04T21:04:22Z", limit: "10")) { result, response, error in
}
Genady Okrain, [email protected], @genadyo
Lyft 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。