Can I use CLLocationSpeed to detect if the device is moving?

I use CLLocationSpeed to detect if the device is moving.

I have something like this:


if (location.speed < 1.38) {

doSomething()

}


location is a CLLocation object.

1.38 m/s is average walking speed.


But when I am moving, like on a bus or taxi. doSomething() still got called.

Am i using the location.speed in a wrong way?


If I only want to doSomething() when the device is still, how can I do?

Thanks!