Priya Priya - 6 months ago 17
iOS Question

iOS Sharing our own location to Other?


  • sharing our 'location' by Clicking on 'Button'?

  • I want to
    share
    our
    current location
    from self 'viewcontroller' to
    Next view controller

  • as like
    whatsApp
    and
    FaceBook
    location Sharing


    is it Possible to Share Our Own Location?


Answer

.h

   CLLocationManager *locationManager;

.m

locationManager = [[CLLocationManager alloc] init];
locationManager.distanceFilter = kCLDistanceFilterNone;
locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters;
[locationManager startUpdatingLocation];
[locationManager requestWhenInUseAuthorization];

latitude = locationManager.location.coordinate.latitude;
longitude = locationManager.location.coordinate.longitude;

send it where u want.