How to calculate speed of our car using iphone

后端 未结 2 1262
无人及你
无人及你 2020-12-14 11:25

For my application I want to calculate my car/bike speed using iphone. How can i do that? Ideally, it should run continuously in the background.

2条回答
  •  抹茶落季
    2020-12-14 12:26

    CLLocation includes a speed property that will give you the current speed of the device. (Note the comment about the accuracy at that link.)

    To get the user's current location, follow the steps in the Location Awareness Programming Guide, under "Getting the User's Current Location".

    Finally, to enable location updates in the background, see Receiving Location Events in the Background in the iOS Application Programming Guide.

提交回复
热议问题