iOS gives us a ton of great capabilities to build upon. Being able to use the user's current geographic location in our apps really has changed the world.
We always need to ask for the user's permission first though, so we might as well do it in style! Today we'll check out a simple yet beautiful library from Sven Tiigi called STLocationRequest that uses Flyover to provide a great looking "location access prompt" view controller.
We'll begin by importing STLocationRequest, and configuring and showing a location request controller.
self.showLocationRequestController(
setTitle: "Allow location access?",
setAllowButtonTitle: "Sure",
setNotNowButtonTitle: "Nope",
setMapViewAlphaValue: 0.7,
setBackgroundViewColor: .orangeColor()
)
Then, we can subscribe to the NSNotifications the library posts to know how the user responds.
More info about STLocationRequest can be found at git.io/stlocationrequest