# Tutorial 3: Question about stopping location manager after accuracy levels out

**URL:** <https://forums.kodeco.com/t/tutorial-3-question-about-stopping-location-manager-after-accuracy-levels-out/32608>\
**Category:** iOS Apprentice\
**Created:** [July 26, 2017, 7:08am UTC](https://forums.kodeco.com/t/tutorial-3-question-about-stopping-location-manager-after-accuracy-levels-out/32608 "2017-07-26T07:08:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sekarb](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/sekarb/32/69707_2.png) [@sekarb](https://forums.kodeco.com/u/sekarb)\
**Post date:** [July 26, 2017, 7:08am UTC](https://forums.kodeco.com/t/tutorial-3-question-about-stopping-location-manager-after-accuracy-levels-out/32608/1 "2017-07-26T07:08:56Z")

</div>

On the book, on page 53, it says “When the last couple of coordinates you received aren’t increasing in  
accuracy then this is probably as good as it’s going to get and you should let the  
radio power down.”. Then the code follows as below…

// 3  
**if location == nil || location!.horizontalAccuracy \> newLocation.horizontalAccuracy** {  
// 4  
lastLocationError = nil  
location = newLocation  
updateLabels()  
// 5  
if newLocation.horizontalAccuracy \<= locationManager.desiredAccuracy {  
print(“\*\*\* We’re done!”)  
stopLocationManager()  
}  
}

Question:  
This code will stop location manager when it eventually reaches the desiredAccuracy.

But say, after a while the accuracy levels out, but never reaches the desiredAccuracy. Then the stopLocationManager will never be called from what I understand.  
So I don’t see this accomplishing what is mentioned at the beginning of this post.

Am I missing something?

Thanks

- Sekar

---

<div class="post-metadata">

**Author:** ![hollance](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/hollance/32/109009_2.png) [@hollance](https://forums.kodeco.com/u/hollance)\
**Post date:** [July 26, 2017, 8:37am UTC](https://forums.kodeco.com/t/tutorial-3-question-about-stopping-location-manager-after-accuracy-levels-out/32608/2 "2017-07-26T08:37:55Z")

</div>

Keep on reading. 😃 You will also add a timeout that stops the location manager after a few seconds.

---

<div class="post-metadata">

**Author:** ![sekarb](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/sekarb/32/69707_2.png) [@sekarb](https://forums.kodeco.com/u/sekarb)\
**Post date:** [July 26, 2017, 4:57pm UTC](https://forums.kodeco.com/t/tutorial-3-question-about-stopping-location-manager-after-accuracy-levels-out/32608/3 "2017-07-26T16:57:28Z")

</div>

ok…😀 I will wait till I finish the tutorial 🙂

thanks
