سؤال

I'm trying to figure out how i can find data (from JSON) near to the users location on iPhone.

My input consists out of 2 parts, so in order to get to the city and address, I have to get an ID from the province where the user is located.

  1. Province (with ID to go to all Json data of the province)
  2. Data (Every piece of data has a name, city, address, ...)

Is it possible to find the province where the user is located. Then pass its ID to search the list of data for near to the user located events by reversing all the addresses and cities into coordinates,...?

I'm pretty new to location based programming! Any help is appreciated!

Thank you very much!

هل كانت مفيدة؟

المحلول

The first thing you'll want to do is add CoreLocation to your app. This tutorial shows you how to do that. This will give you the latitude and longitude of your current location.

The next thing you'll want to do is reverse geocode your coordinates. One common API for this is the Google Geocoding API. That will give you your province name.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top