Check if the user's location is in India - ios

I would like to check if the user's country is in India. How can I do that in Swift? What library can I use do accomplish this task? I want to do this to display different prices for India users as a test.
I think I figured it out. Is it NSLocale.current.regionCode. Is so what's the code for India?

I don't know much about Swift, but I think this might help:
To get a user's current location, you'll first need to import MapKit and CoreLocation in the top of your view controller. You will have to decide whether your application will need the users location always (even when in it's in the background) or only when the apps in use.
-How to get Current Location in Swift

Related

Proximity Based Search without user location swift

I'm working on an app which utilizes Google Places API in order to find locations based on a users search. I've implemented the search with the help of the UIAutocomplete (Google Places), but unfortunately, it is not location based (until the user provides authorization). I was wondering if there is a way to get the users location through their IP address or otherwise using Swift. I don't need a precise location, the city would be enough.
I've searched for a while and there doesn't seem to be any other way of doing this, so if you know of an API which can return the city the user is currently in, that would be great.
Thanks for all the help,
Vlad
I don't think the system frameworks allow you to get the user's remote IP address anymore. A solution for you might be to use a website like http://mylocation.org/, which shows your IP address and location. Perhaps you can make a request to this website and parse out the HTML that comes back to get the location. Please note, this isn't the most accurate way of getting the user's location and you would be much better off using the CoreLocation framework.

search nearby places from database [swift]

I am developing an app which allows users to search nearby place according to the radius provided by the user. I have some places stored in a realm database with the latitude and longitude of that place. I am able to get the users current latitude and longitude but i don't know how to implement the logic to present the user with places that are closest to him. I can calculate the distance between users current location and a particular location using CLLocationDistance = currentlocation.distanceFromLocation(destinationLocation).
Please point me in the right direction or provide me with a sample code.
If it's not possible with Realm then let me know which database solution is the best option.
This isn't currently possible in native Realm queries, but it's something that's actively being worked on! (see https://github.com/realm/realm-cocoa/pull/2199 for a current pull request)

Allow users to input the location of an event IOS

I am trying to construct an app for IOS 8 using swift in which users have the ability to post the location of an event, and people within a certain distance have the opportunity to see it based on their current location.
After looking around for awhile, I am getting the notion that this is not possible. I know it is possible if it is based on the user that posts current location (Yik Yak), but I am not if there is a way to let them actually input an address with maps.
Does anyone have a potential answer to this?
Thanks!
You can certainly have a user insert locations and such by importing MapKit.

MKLocalSearch with wildcard

Is there a way to get all places of an given region?
I would like to offer the user a list of all existing venues in a region when he taps the screen, but I only found ways to use MKLocalSearch with a specific search query string.
Is there a way to get all places of an given region?
There's nothing built into MapKit or Core Location that provides that kind of information. Your best bet would be to look for a suitable data source for the kinds of "venues" that you're interested in, such as Google, Yelp!, FourSquare, yellow pages, etc.

iOS6 Get List of Street by first symbols

I just playing with MapKit and it's going well. If we looking at Native App (Maps) there are possible to find direction between two places. What is intresting for me - how they get list of Street when you type name? There are in SDK some possibility to get Streets list by couple of symbols?
Thanks.
I'm not a Map Kit expert but I recommend you review the Map Kit Framework and especially the MKLocalSearch Class Reference.
The MKLocalSearch class allows you to search for addresses in a region as an equivalent of a search in the Map app. I'm not aware of any API that allows you to retrieve ALL the streets in a region.
MKLocalSearch is the best and easiest way to do instant search of google maps,i have done it and its awesome and very simple

Resources