I'm using the Uber SDK for iOS and more specifically a RideRequestWidget to allow my users to call an uber. I'm curious is if there is any way you could perform a segue in the background when the RideRequestButton is pressed.
ex: I have the RideRequestButton on one view controller and when my users are done with Uber and have arrived they need to be directed back to a different view controller than where they started. Does anyone have an idea on how to do this or a different way to do it?
Thank you so much!
答案 0 :(得分:0)
如果我正确理解您,当用户解除Ride Request Widget时,您是否希望将它们带到与其启动位置不同的屏幕上?
我看到了两个选项来实现这个目标:
1)在您拥有按钮的视图控制器中,符合ModalViewControllerDelegate
协议。使用RideRequestButton
创建RideRequestViewRequestingBehavior
时,请将视图控制器设置为rideRequestViewRequestingBehaviorObject.modalRideRequestViewController
的委托,因此当用户解除Ride Request Widget时,modalViewControllerDidDismiss
委托方法将为调用,你可以在那时做自定义segue。
2)您可以创建自己的自定义视图控制器,其中包含RideRequestView
,您可以在其中提供控件以允许用户关闭视图控制器。这样你就可以控制下一步的去向。你仍然可以使用RideRequestButton
,你只需要创建一个符合RideRequesting
协议的自定义类,然后用它初始化RideRequestButton
。如果您采用这种方法,则需要单独处理登录,因为RideRequestView
没有为您处理(由RideRequestViewController
处理)