Q:

IOS Core Location framework accuracy

I am writing an app in Swift to capture and save the location of the phone.
I am planning to use Core Location framework. This framework provides several services that you can use to get and monitor the device’s current location.
Here are a few questions I have: 
1. Does Core Location framework uses the phone GPS to get the longitude and latitude or the cell data?
2. What if the phone is in your car, pocket, bag or purse. Can it still get a correct location (longitude and latitude)?
3. If the answer to #2 is false, then what other alternative I have?

A:

Does Core Location framework uses the phone GPS to get the longitude and latitude or the cell data?

It does if it needs GPS for the specified accuracy. When you use Core Location, you tell it how accurate you need to be, and Core Location will turn on GPS if a) GPS is available on the device, and b) it needs GPS to get the accuracy you requested.

What if the phone is in your car, pocket, bag or purse. Can it still get a correct location (longitude and latitude)?

It can, unless it can't. GPS works reasonably well in a car. Pockets, bags, etc. aren't a problem. But GPS receivers do need to be able to receive radio signals from satellites, so if your car is parked on the bottom floor of an underground parking garage, or even if you're just inside a building, it may not work. Core Location will then use whatever other means are available for determining location, such as WiFi and cell tower triangulation.

If the answer to #2 is false, then what other alternative I have?

You really don't have any alternatives to Core Location, but Core Location has a number of ways to determine location. So use it as necessary (and avoid using it when you don't need it, since it does use power) and trust it to do the right thing.

