We can locate where the user is with the help of IOS, but the user should allow the application to access the information with core location framework.
Step 1. Create a simple View based application.
Step 2. Select your project file, then select targets and then add CoreLocation.framework as shown below −
Step 3. Add two labels in ViewController.xib and create ibOutlets naming the labels as latitudeLabel and longitudeLabel respectively.
Step 4. Create a new file by selecting File-> New -> File... -> select Objective C class and click next.
Step 5. Name the class as LocationHandler with "sub class of" as NSObject.
Step 6. Select create.
Step 7.We need to update LocationHandler.h as follows −
Step 9. Update ViewController.h as below, where we need to implement the LocationHandler delegate and create two ibOutlets −
Step 10. Update ViewController.m as follows −
On executing the application, we'll get the below result as output −
IOS Related Interview Questions
|C Interview Questions||IPHONE APPS Interview Questions|
|Android Interview Questions||Mobile Testing Interview Questions|
|Java Native Interface (JNI) Interview Questions||JNDI (Java Naming and Directory Interface) Interview Questions|
|Mobile computing Interview Questions||jQuery Mobile Interview Questions|
|Mobile Security Interview Questions||Objective C Interview Questions|
|Mobile Developer Interview Questions||Mobile Application Testing Interview Questions|
|Mobile Marketing Interview Questions|
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.