In this application, GPS will allow us to track where the user has been; this will give us an idea about where the pictures might have been taken. As we are going to use GPS, we need to add a record in info.plist
that gives the user a message saying that we are going to use this sensor. This is a requirement as of iOS 8.
Click on the info.plist
file located in your Project Navigator. Add a new record and set NSLocationWhenInUseUsageDescription
as key and as value a phrase like This app needs permission for using GPS
. Here, you have a sample:
We have used NSLocationWhenInUseUsageDescription
instead of NSLocationAlwaysUsageDescription
as our extension uses only the first one. If you need to use the second one, you have the advantage of being able to easily change DRPReactiveCoreLocation
in the source code.
Now, we are ready to create a new View Controller that will use GPS. Using command + N, add a new Swift file called TakePicturesViewController.swift
. Just...