Hello,
In chapter 29, in viewDidLoad(), instead of showLocations(), I want to showUser() to show user’s location to start with. Here is what I did:
override func viewDidLoad() {
print(“ViewDidLoad”)
super.viewDidLoad()
updateLocations()
// if !locations.isEmpty {
// showLocations()
// }
showUser()
}
However, the above modification does not quite work as I wanted. The map zoom in to an unknown location if I switch from other Tabs to Map Tab.
After that, if I tap the showUser Button, it worked just fine by showing my location
I have also tried putting showUser() to viewDidAppear and viewWillAppear() as well but that didn’t help either
Can you let me know how to fix this problem ?
Thank you