Request the Location Services via a 3D 360° flyover MKMapView 🗺

Overview

Logo


STLocationRequest

Swift 5.0 Version Carthage Compatible Platform Documentation Twitter

STLocationRequest is a simple and elegant way to request the users location services at the very first time. The STLocationRequestController shows a beautiful 3D 360° Flyover-MapView bult on top of FlyoverKit with over 25 cities and landmarks.

Preview GIF

Installation

CocoaPods

STLocationRequest is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'STLocationRequest'

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate STLocationRequest into your Xcode project using Carthage, specify it in your Cartfile:

github "SvenTiigi/STLocationRequest"

Run carthage update --platform iOS to build the framework and drag the build:

  • STLocationRequest.framework
  • FlyoverKit.framework

into your Xcode project.

On your application targets’ “Build Phases” settings tab, click the “+” icon, choose “New Run Script Phase” and add the Framework paths (for all Frameworks) as mentioned in Carthage Getting started Step 4, 5 and 6

Usage

import STLocationRequest

// Initialize STLocationRequestController with STLocationRequestController.Configuration
let locationRequestController = STLocationRequestController { (config: inout STLocationRequestController.Configuration) in
    config.title.text = "We need your location for some awesome features"
    config.allowButton.title = "Alright"
    config.notNowButton.title = "Not now"
    config.mapView.alpha = 0.9
    config.backgroundColor = UIColor.lightGray
    config.authorizeType = .requestWhenInUseAuthorization
}

// Get notified on STLocationRequestController.Events
locationRequestController.onEvent = { event in
    if case .locationRequestAuthorized = event {
        // Location Request Authorized 🙌
    }
}

// Present STLocationRequestController
locationRequestController.present(onViewController: self)

Please keep in mind that the 3D flyover view will only work on a real iOS device (Read more).

Configuration

The STLocationRequestController can be customized via the the STLocationRequestController.Configuration struct. There are plenty of options available 👨‍💻 More details can be found here

OnEvent

The onEvent function get invoked if an STLocationRequestController.Event occured. Simply set an anonymous function of type (Event) -> Void to evaluate the event.

locationRequestController.onEvent = { (event: STLocationRequestController.Event) in
    switch event {
        case .locationRequestAuthorized:
            break
        case .locationRequestDenied:
            break
        case .notNowButtonTapped:
            break
        case .didPresented:
            break
        case .didDisappear:
            break
    }
}

Info.plist

To perform a location request, define a usage description in your Info.plist file.

STLocationRequestController.Authorization.requestWhenInUseAuthorization

<key>NSLocationWhenInUseUsageDescription</key>
<string>The usage description</string>

STLocationRequestController.Authorization.requestAlwaysAuthorization

<key>NSLocationAlwaysUsageDescription</key>
<string>The usage description</string>

The usage description will be shown in the default iOS location request dialog after the user taps the allow button.

Presenting-Recommendation

The recommended way to present STLocationRequestController is:

if STLocationRequestController.shouldPresentLocationRequestController {
    // Location Services are enabled and authorizationStatus is notDetermined
    // Ready to present STLocationRequestController
    self.presentLocationRequestController()
}

iOS Simulator

Please keep in mind that the 3D flyover view will only work on a real iOS device with at least iOS 9.0 installed (Apple Developer API Reference). A Screenshot taken from an iOS Simulator running a STLocationRequestController visualizes the iOS Simulator behaviour.

iOSSimulatorBehavior

Dependencies

STLocationRequest uses the following libraries.

Contributing

Contributions are very welcome. 🙌 🤓

Example Application

To run the example Application, generate the Frameworks via Carthage first.

$ carthage update --platform iOS
$ open STLocationRequest.xcodeproj

License

STLocationRequest
Copyright (c) 2020 Sven Tiigi <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Comments
  • Can't close modally presented ViewController any more

    Can't close modally presented ViewController any more

    Until now I have used STLocationRequest in a "normal" ViewController. The only thing I changed was presenting the VC modally but now I can't close the VC itself anymore after showing the LocationRequest.

    I use self.navigationController?.dismissViewControllerAnimated(true, completion: nil) for closing and it's working everywhere fine but not in the VC with the LocationRequest...

    opened by LucasZL 8
  • Use STLocationRequest in objective-c ViewController

    Use STLocationRequest in objective-c ViewController

    Hello I'm getting this error.

    fatal error: unexpectedly found nil while unwrapping an Optional value (lldb)

    I have a felling that the storyboard view is not loading but I'm not sure.This is how I try to present the view

    STLocationRequestController *request = [[STLocationRequestController alloc] init]; [request setTitle:@"test"]; [request setTitleLabelText:@"test"]; [request setAllowButtonTitle:@"Alright"]; [request setNotNowButtonTitle:@"eded"]; [request setMapViewAlphaValue: 0.9]; [request setBackgroundViewColor: [UIColor lightGrayColor]]; [self presentViewController:request animated:YES completion:nil];

    opened by JeanPierreFig 7
  • Swift 4.2 Support?

    Swift 4.2 Support?

    The library, and underlying FlyoverKit does not compile with Swift 4.2 with a lot of deprecation issues. Is update to 4.2 is expectable anywhere soon?

    question 
    opened by qodeboy 3
  • not working on IOS 11

    not working on IOS 11

    Hi there,

    It docent work after upgraded to iOS 11.

    The popup box with "Alright" is clickable but docent accecpt the selection.

    But if pressing " Not now " it goes away as it should.

    opened by applesolutions 3
  • using pod with Swift 3.0 project

    using pod with Swift 3.0 project

    Hi! I'm trying to use this cool library in a Swift 3.0 project with pod. The problem is that when I'm doing pod install "Font-Awesome", 1.5.3 is installed instead of the 1.6.1, so the project doesn't compile because the 1.5.3 code is not written in Swift 3.0

    What should I do :) ?

    Thanks

    Luca.

    opened by Hero93 3
  • never show 3D scene once click Present STLocationRequestController -> Alright

    never show 3D scene once click Present STLocationRequestController -> Alright

    Hi Sven Tiigi, Thanks a lot for this awesome app! Would you mind take a look at the issue I have when I build and run it on my iPhone6+?

    I build app with Xcode9.2 & I put screen record on youtube: https://youtu.be/7i2Z4zp91To Xcode debug console shows following error, is this expected because of no 3D flyover data for my GPS location?

    I already allowed STLocationRequest to access my location while using the app.

    2018-03-03 07:08:29.613910-0800 STLocationRequestExample[2286:581454] Could not inset compass from edges 9 2018-03-03 07:08:29.614784-0800 STLocationRequestExample[2286:581454] Could not inset scale from edge 9 2018-03-03 07:08:29.642869-0800 STLocationRequestExample[2286:581454] Could not inset legal attribution from corner 4 2018-03-03 07:08:29.818637-0800 STLocationRequestExample[2286:581454] Could not inset legal attribution from corner 4 2018-03-03 07:08:30.018142-0800 STLocationRequestExample[2286:581454] Could not inset compass from edges 9 2018-03-03 07:08:30.018310-0800 STLocationRequestExample[2286:581454] Could not inset scale from edge 9 2018-03-03 07:08:30.638770-0800 STLocationRequestExample[2286:581610] Download failed: {x:2623 y:6334 z:14 (2623.6334.14 type: 16 pixel: 2 r2: 920000 Voltaire3D)} Error: Error Domain=GEOErrorDomain Code=-7 "(null)" UserInfo={HTTPStatus=404, NSErrorFailingURLStringKey=https://gspe11-ssl.ls.apple.com/tile?style=16&v=1203&z=14&x=2623&y=6334&sid=1448789466378065446706432234197647015410&accessKey=1520093909_ezmqz9c5nWKP2G61_ETJGJBlfWyYvciaFgB4sJByi2UyeMYVMAhcYOLBlpdmY62QGO77JKk20DxJpPqaKAp8ZlmY8jNaXeN7OY5G5Yfq2SIfwKRsLBiMr7DxJtL1MpokVpcyPZ3Ll9ZjRCccHsQVnp9NokUl%2BZVwzU0aMWQ%3D%3D} 2018-03-03 07:08:30.639438-0800 STLocationRequestExample[2286:581552] Download failed: {x:4822 y:6161 z:14 (4822.6161.14 type: 16 pixel: 2 r2: 260000 Voltaire3D)} Error: Error Domain=GEOErrorDomain Code=-7 "(null)" UserInfo={HTTPStatus=404, NSErrorFailingURLStringKey=https://gspe11-ssl.ls.apple.com/tile?style=16&v=1035&z=14&x=4822&y=6161&sid=1448789466378065446706432234197647015410&accessKey=1520093910_Q90fkWbwsaqZXDsO_Fetx3JZchM%2Bn3YnAs99s3tEvMhUpPJ8xaFafOcdSx%2BLaLKJzuE9uSc3lppshFToECwiQfD%2Fqf9%2BeQIfFmueFKPeW6WjEAKc0l%2F8ztZ7H1u%2FKE14O2G1XigPkqFn8K8U1mwNVlprmD3ugQl0M3%2FvL0w%3D%3D} 2018-03-03 07:08:30.639226-0800 STLocationRequestExample[2286:581620] [VKDefault] Failed to load DTM: 10049 2623 14 2018-03-03 07:08:30.640476-0800 STLocationRequestExample[2286:581620] [VKDefault] Failed to load DTM: 10222 4822 14 Retrieved STLocationRequestController.Event: didPresented STLocationRequestController did presented 2018-03-03 07:08:35.559640-0800 STLocationRequestExample[2286:581611] Download failed: {x:4821 y:6161 z:14 (4821.6161.14 type: 16 pixel: 2 r2: 260000 Voltaire3D)} Error: Error Domain=GEOErrorDomain Code=-7 "(null)" UserInfo={HTTPStatus=404, NSErrorFailingURLStringKey=https://gspe11-ssl.ls.apple.com/tile?style=16&v=1035&z=14&x=4821&y=6161&sid=1448789466378065446706432234197647015410&accessKey=1520093915_LuvdJ7DpttTeiG5e_v42WPWU%2FXIuCWUWl4PTDKboQZXEKMtmSUZR7QZxXv5CQsKMoxcfOFd5nLAcE3%2F%2FAZA4vwcy9q8pryaHk8BN%2F29ii%2BUE7joCLV7d1%2FfrHKUhj9Ls8ObVj0DUaRg4Z9NhIzm8l1KzUu4MOsCUU81pK4w%3D%3D} 2018-03-03 07:08:35.560459-0800 STLocationRequestExample[2286:581620] [VKDefault] Failed to load DTM: 10222 4821 14 Retrieved STLocationRequestController.Event: locationRequestAuthorized The user accepted the use of location services didUpdateLocations UserLocation: Optional(<+37.68481274,-121.87087337> +/- 5.00m (speed 0.00 mps / course -1.00) @ 3/3/18, 7:07:32 AM Pacific Standard Time) 2018-03-03 07:08:52.241496-0800 STLocationRequestExample[2286:581933] Download failed: {x:4823 y:6160 z:14 (4823.6160.14 type: 16 pixel: 2 r2: 260000 Voltaire3D)} Error: Error Domain=GEOErrorDomain Code=-7 "(null)" UserInfo={HTTPStatus=404, NSErrorFailingURLStringKey=https://gspe11-ssl.ls.apple.com/tile?style=16&v=1035&z=14&x=4823&y=6160&sid=1448789466378065446706432234197647015410&accessKey=1520093931_xrU35PRj6DtyWNeh_f66Eu7UtuTstJ4vimk1Rv8zhzE9g8MIr9LFpuuirjUEvolmLjuhVjhfhmbSuAyFaVla2elxEuNuisCsxWgzZwQUDFcmR04KYP3JBBZjm8GOuf7IVIV%2FrljSoWUDcu3NAkX35pvRNX%2F%2B%2BuBPU6bAd9Q%3D%3D} 2018-03-03 07:08:52.241706-0800 STLocationRequestExample[2286:581620] [VKDefault] Failed to load DTM: 10223 4823 14 Retrieved STLocationRequestController.Event: didDisappear STLocationRequestController did disappear 2018-03-03 07:08:52.378263-0800 STLocationRequestExample[2286:581947] Download failed: {x:77178 y:98571 z:18 (77178.98571.18 type: 15 pixel: 2 text: 2 r2: 260000 Voltaire3D)} Error: Error Domain=GEOErrorDomain Code=-2 "(null)"

    help wanted 
    opened by keinyuan 2
  • Allow for Custom Locations

    Allow for Custom Locations

    I'd be super if I could specify a custom location. Currently I have to edit the code and add the new location + GPS info. Then updates to the code remove that custom location.

    opened by DaveInTO 2
  • Improved readability and project fixes here and there

    Improved readability and project fixes here and there

    • Fixed code layout by replacing spaces with tabs in the whole project
    • Constraints remade from the ground-up
    • Fixed a UI bug appearing in Lanscape mode while using an iPhone
    • Increased readability for the two buttons by adding a semi-transparent color
    • Increased readability of the map by increasing it's alpha value in the example project
    • Xcode project updated (Storyboards, .xib, xcassets)
    • Landscape is now supported in both ways (Left & Right)
    • Now the top label is a multilines UILabel instead of being limited to 3 lines
    • Fixed Swift syntax
    opened by giulio92 2
  • Compilation errors in STLocationRequestController

    Compilation errors in STLocationRequestController

    Hi,

    First let me say that your library looks awesome! I'm trying to use it in my project but I'm having some problems.

    I modified my Podfile to include STLocationRequest:

    platform :ios, '8.0'
    use_frameworks!
    
    target 'Squirlo' do
    pod 'Google/SignIn'
    pod 'GoogleMaps'
    pod 'STLocationRequest'
    end
    
    target 'SquirloTests' do
    end
    
    target 'SquirloUITests' do
    end
    

    This is the output I'm getting when I'm running pod install:

    Updating local specs repositories
    
    CocoaPods 1.0.0 is available.
    To update use: `gem install cocoapods`
    Until we reach version 1.0 the features of CocoaPods can and will change.
    We strongly recommend that you use the latest version at all times.
    
    For more information see http://blog.cocoapods.org
    and the CHANGELOG for this version http://git.io/BaH8pQ.
    
    Analyzing dependencies
    Downloading dependencies
    Installing Font-Awesome-Swift (1.4.7)
    Using Google (2.0.4)
    Using GoogleAppUtilities (1.1.0)
    Using GoogleAuthUtilities (2.0.0)
    Using GoogleInterchangeUtilities (1.2.0)
    Using GoogleMaps (1.13.0)
    Using GoogleNetworkingUtilities (1.2.0)
    Using GoogleSignIn (3.0.0)
    Using GoogleSymbolUtilities (1.1.0)
    Using GoogleUtilities (1.3.0)
    Installing STLocationRequest (0.2.0)
    Generating Pods project
    Integrating client project
    Sending stats
    Pod installation complete! There are 3 dependencies from the Podfile and 11 total pods installed.
    

    The problem is that when I go back to Xcode, I'm getting compilation errors coming from STLocationRequestController. In particular the compilation error I'm getting is for the following line:

    self.timer = NSTimer.scheduledTimerWithTimeInterval(15, target: self, selector: #selector(STLocationRequestController.changeRandomFlyOverCity), userInfo: nil, repeats: true)
    

    I can fix that by manually changing the above line to the following:

    self.timer = NSTimer.scheduledTimerWithTimeInterval(15, target: self, selector: "changeRandomFlyOverCity", userInfo: nil, repeats: true)
    

    After fixing the above error, I'm trying to use the library but when I'm trying to import STLocationRequest I'm getting an error saying No such module 'STLocationRequest'

    What am I doing wrong?

    Many thanks, Alex

    opened by alex-ntousias 1
  • Memory leaks

    Memory leaks

    I found memory usage increased every time when a new STLocationRequestController was created and dismissed. It seems like you didn't invalidate the timer.

    Solution: [viewDidLoad] // assign the timer to a local var timer: NSTimer? timer = NSTimer.scheduledTimerWithTimeInterval(15, target: self, selector: "changeRandomFlyOverCity", userInfo: nil, repeats: true)

    [viewDidDisappear] // invalidate the timer and release it. timer?.invalidate() timer = nil

    opened by royhsu 1
  • UITapGestureRecognizer doesn't work

    UITapGestureRecognizer doesn't work

    I'm using the mapView as the background for my login screen. I added a UITapGestureRecognizer to self.view but it hardly works. The Selector just does: self.view.endEditing(true) yet it only works very rarely after tapping the screen multiple times.

    My only assumption is that since the screen is rotating; tap gestures are not always recognized. I tried implementing all different types of gestures and overriding UIGestureRecognizerDelegate methods but nothing seems to work.

    Any ideas?

    opened by bojanstef 1
Releases(3.3.1)
  • 3.3.1(Apr 2, 2019)

  • 3.3.0(Jan 18, 2019)

    Swift 4.2

    Added Swift 4.2 compatibility

    📺 tvOS Support

    Added tvOS support

    LocationSymbolIcon

    This release dropped custom LocationSymbolIcon support

    Source code(tar.gz)
    Source code(zip)
  • 3.2.2(May 24, 2018)

  • 3.2.1(Mar 29, 2018)

  • 3.2.0(Feb 28, 2018)

    FlyoverKit

    The Engine of the STLocationRequestController has been fully replaced with the newly released FlyoverKit.

    Button Configuration

    The configuration for the allow and not-now button has been expanded. You can now set the following properties to customize the buttons to your needs.

    • title
    • titleColor
    • font
    • backgroundColor
    • highlightedBackgroundColor
    • highlightedTitleColor
    • borderColor
    • borderWidth
    • cornerRadius
    Source code(tar.gz)
    Source code(zip)
  • 3.1.0(Feb 17, 2018)

    Carthage

    With this release STLocationRequest is also available via Carthage.

    Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

    You can install Carthage with Homebrew using the following command:

    $ brew update
    $ brew install carthage
    

    To integrate STLocationRequest into your Xcode project using Carthage, specify it in your Cartfile:

    github "SvenTiigi/STLocationRequest"
    

    Run carthage update --platform iOS to build the framework and drag the built STLocationRequest.framework, SnapKit.framework and SwiftIconFont.framwork into your Xcode project.

    On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase” and add the Framework paths (for all Frameworks) as mentioned in Carthage Getting started Step 4, 5 and 6

    Configuration

    The STLocationRequestController.Configuration struct has been slightly modified in order to have a consistent access to specific variables.

    config.titleText // No longer available
    config.title.text = "Use this 🙌"
    
    Source code(tar.gz)
    Source code(zip)
  • 3.0.1(Jan 30, 2018)

  • 3.0.0(Jan 29, 2018)

    Version 3.0

    The STLocationRequestController has been completely refactored and improved. The most important changes are the construction and configuration for an STLocationRequestController object as well as the new onEvent closure property. The following usage code snippet will show how to migrate to the 3.0 version.

    Usage

    import STLocationRequest
    
    // Initialize STLocationRequestController with STLocationRequestController.Configuration
    let locationRequestController = STLocationRequestController { config in
        config.titleText = "We need your location for some awesome features"
        config.allowButtonTitle = "Alright"
        config.notNowButtonTitle = "Not now"
        config.mapViewAlpha = 0.9
        config.backgroundColor = UIColor.lightGray
        config.authorizeType = .requestWhenInUseAuthorization
    }
    
    // Get notified on STLocationRequestController.Events
    locationRequestController.onEvent = { event in
        if case .locationRequestAuthorized = event {
            // Location Request Authorized 🙌
        }
    }
    
    // Present STLocationRequestController
    locationRequestController.present(onViewController: self)
    

    Objective-C Support?

    The Objective-C support has been removed in this version to be compatible with the Swift coding standards. If you need to use the STLocationRequestController inside an Objective-C Project you should bind the Pod to the 2.0 Version:

    pod 'STLocationRequest', '~> 2.0'
    
    Source code(tar.gz)
    Source code(zip)
  • 2.0.0(Nov 19, 2017)

    Version 2.0

    STLocationRequest is now updated to version 2.0 🙌

    • The most important part is the removed Storyboard, which was former used to layout the UI. All UI layouting is now being done in code 👨‍💻.
    • STLocationRequestController has now even more properties to customize it 🤓
    • Improved Objective-C support
    • Improved Notch-Support for iPhone X
    Source code(tar.gz)
    Source code(zip)
  • 1.5.1(Nov 12, 2017)

  • 1.4.2(Sep 21, 2017)

    Improved layout support for iPhone X (PR https://github.com/SvenTiigi/STLocationRequest/pull/18) and updated Font-Awesome-Swift Version to 1.6.4

    Source code(tar.gz)
    Source code(zip)
  • 1.4.0(Mar 26, 2017)

    From now on you can add your own custom places to the STLocationRequestController

    Example

    // Add place via latitude and longitude
    locationRequestController.addPlace(latitude: 51.960665, longitude: 7.626135)
    
    // Add place via CLLocationCoordinate2D
    let myCoordinate = CLLocationCoordinate2DMake(51.960665, 7.626135)
    locationRequestController.addPlace(coordinate: myCoordinate)
    

    Only show custom places

    If you wish to show only your custom places just set the placesFilter to .customPlaces

    // Only your custom places will be shown
    locationRequestController.placesFilter = [.customPlaces]
    

    Satellite Flyover

    Please keep in mind to check if your location is available in 3D-Flyover mode. To check just go to Apple Maps App and search your location and tap on the 3D-Button

    Your place is awesome?

    If you found an awesome place that should be default implemented to the STLocationRequestController then just contribute it via a pull request. 👍

    Source code(tar.gz)
    Source code(zip)
  • 1.3.6(Mar 25, 2017)

  • 1.3.5(Mar 25, 2017)

  • 1.3.4(Mar 25, 2017)

    General Improvements

    Updated Code to Swift Design Guidelines. And optimized code.

    Font-Awesome-Swift

    Updated Dependency to Version 1.6.1

    Present CompletionBlock

    From now on you can specify an optional completion block when you call the present method

    locationRequestController.present(onViewController: self) { 
                // Do awesome stuff here
    }
    
    Source code(tar.gz)
    Source code(zip)
  • 1.3.3(Oct 30, 2016)

    Places-Filter

    From now on you can specify which awesome places should been displayed. The optional attribute placesFilter can be filled with an array of STAwesomePlace enums. If you wish to show all awesome places, you leave the attribute placesFilter nil.

    // Only San Francisco Golden Gate Bridge and the Colosseum in Rome will be shown
    locationRequestController.placesFilter = [.sanFranciscoGoldenGateBridge, .romeColosseum]
    

    The default value is nil

    More Awesome-Places

    • Luxor Resort Las Vegas
    • Apple Headquarter
    • Muenster castle
    • Piazza Di Trevi Rome
    Source code(tar.gz)
    Source code(zip)
  • 1.3.1(Oct 23, 2016)

  • 1.2.0(Sep 5, 2016)

    In this release we standardize the naming convention for the STLocationRequest repository. The STLocationRequest repository holds the STLocationRequestController so we have changed a lot of code that will also effect your existing code which is connected to the STLocationRequestController. We removed the Class STLocationRequest which was used to set the attributes like titleText, delegate, etc. and the initialization for the Storyboard File.

    From now on you initialize the STLocationRequestController like this:

    let locationRequestController = STLocationRequestController.getInstance()
    

    To present the STLocationRequestController we make it more clear and changed it to:

    locationRequestController.present(onViewController: self)
    

    The STLocationRequestController.getInstance() Method take care of the initialization of the Storyboard File. If you initialize STLocationRequestController by a standard Object initialization

    let locationRequestController = STLocationRequestController() // use .getInstance()
    

    and present the ViewController you will get be notified by a console output:

    WARNING: Please initialize the STLocationRequestController via "STLocationRequestController.getInstance()" otherwise the Storyboard File can't be loaded from the Pod"
    

    Other naming convention changes

    OLD_NAME => NEW_NAME

    • STLocationRequestDelegate => STLocationRequestControllerDelegate
    • The attribute mapViewAlphaValue => mapViewAlpha
    • STLocationAuthorizeType => STLocationRequestControllerAuthorizeType
    • STLocationRequestEvent => STLocationRequestControllerEvent
    Source code(tar.gz)
    Source code(zip)
  • 1.1.2(Jul 15, 2016)

    In this release we added some bug fixes and added more places like Miami Beach, Central Park, GooglePlex Building, Laguna Beach and Le Moint Saint-Michel.

    Furthermore we added two more customizing options

    // Set the location symbol icon which will be displayed in the middle of the STLocationRequest-Controller.
    // The devault value is FALocationArrow. You can browse at http://fontawesome.io/icons/ or 
    // https://github.com/Vaberer/Font-Awesome-Swift for other icons but be aware to use a icon 
    // which is in the context of a location request.
    locationRequest.locationSymbolIcon = FAType.FALocationArrow
    
    // Set the in the interval for switching the shown places in seconds. Default value is 15 seconds
    locationRequest.timeTillPlaceSwitchesInSeconds = 15.0
    
    Source code(tar.gz)
    Source code(zip)
  • 1.1.1(Jun 25, 2016)

    In this release we have added more options for you to customize the STLocationRequest-Controller for your purpose of usage.

    /// Defines if the pulse Effect which will displayed under the location symbol should be enabled or disabled. Default Value: true
    public var pulseEffectEnabled = true
    
    /// The color for the pulse effect behind the location symbol. Default value: white
    public var pulseEffectColor = UIColor.whiteColor()
    
    // The color of the location symbol which will be presented in the middle of the location request screen. Default value: white
    public var locationSymbolColor = UIColor.whiteColor()
    
    // Defines if the location symbol which will be presented in the middle of the location request screen is hidden. Default value: false
    public var locationSymbolHidden = false
    

    Furthermore we added a new STLocationRequestEvent enum LocationRequestDidDisappear which will be called in the delegate function locationRequestControllerDidChange when the STLocationRequest-Controller did disappear.

     case .LocationRequestDidDisappear:
                break
    
    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Jun 9, 2016)

    Removed UIViewController Extension

    The UIViewController-Extensionself.showLocationRequestController(....) is removed

    New Usage

    From now on you call the STLocationRequest-Controller like this:

    func presentLocationRequest(){
        let locationRequest = STLocationRequest()
        locationRequest.titleText = "We need your location for some awesome features"
        locationRequest.allowButtonTitle = "Alright"
        locationRequest.notNowButtonTitle = "Not now"
        locationRequest.mapViewAlphaValue = 0.9
        locationRequest.backgroundColor = UIColor.lightGrayColor()
        locationRequest.authorizeType = .RequestWhenInUseAuthorization
        locationRequest.delegate = self
        locationRequest.presentLocationRequestController(onViewController: self)
    }
    
    

    We have changed this to add some cool new features in the future. An objective-c version can be found in the ReadMe file.

    Delegate Changed

    The Delegate was renamed from LocationRequestDelegate to STLocationRequestDelegate. Furthermore we have shrinked the delegate method from 4 to 1 method, which will pass as an parameter an enumeration of STLocationRequestEvent. Here is an example for the new delegate method:

    
    func locationRequestControllerDidChange(event: STLocationRequestEvent) {
        switch event {
            case .LocationRequestAuthorized:
                break
            case .LocationRequestDenied:
                break
            case .NotNowButtonTapped:
                break
            case .LocationRequestDidPresented:
                break
        }
    }
    
    

    Features added

    From now on you can decide which AuthorizationType you wanna ask for

    locationRequest.authorizeType = .RequestWhenInUseAuthorization
    

    or

    locationRequest.authorizeType = .RequestAlwaysAuthorization
    

    Please mind that you have to add the description Key to your Info.plist (read more in the ReadMe file in section Info.plist)

    Source code(tar.gz)
    Source code(zip)
  • 1.0.1(Jun 3, 2016)

    Added an alternative way beside the UIViewController Extension of initializing STLocationRequest by creating an instance of STLocationRequest Class. Furthermore added full Objective-C compatibility through the STLocationRequest Class. A code sample for Objective-C was added in the ReadMe file.

    Source code(tar.gz)
    Source code(zip)
  • 0.2.2(May 30, 2016)

  • 0.2.0(Apr 16, 2016)

    From now on you can apply to the LocationRequestDelegate Protocol for events like:

    locationRequestNotNow: The user tapped on the "Not-Now" Button locationRequestAuthorized: The user authorized the location request locationRequestDenied: The user denied the location request locationRequestControllerPresented: The location request is presented

    Please keep in mind that this version removed the NSNotificationCenter Post Methods, so there is no need to add an NSNotificationObserver for STLocationRequest Events.

    Source code(tar.gz)
    Source code(zip)
Owner
Sven Tiigi
iOS Engineer @opwoco
Sven Tiigi
Make permission request easier.

Proposer Proposer provides a single API to request permission for access Camera, Photos, Microphone, Contacts, Reminders, Calendar, Location or Notifi

null 855 Nov 3, 2022
Cluster's reusable pre-permissions utility that lets developers ask the users on their own dialog for photos or contacts access, before making the system-based request.

Cluster's reusable pre-permissions utility that lets developers ask the users on their own dialog for photos or contacts access, before making the system-based request. This is based on the Medium post by Cluster describing the different ways to ask for iOS permissions (https://medium.com/p/96fa4eb54f2c).

Riz 1.2k Sep 29, 2022
360° flyover on a MKMapView 🚁

FlyoverKit enables you to present stunning 360° flyover views on an MKMapView with zero effort while maintaining full configuration possibilities. Fly

Sven Tiigi 693 Jan 3, 2023
A Location Manager for easily implementing location services & geofencing in iOS. Ready for iOS 11.

A Location Manager for easily implementing location services & geofencing in iOS, written in Objective-C. Ready for iOS 11. Features Get current/conti

Benzamin Basher 108 Jul 9, 2022
Enumerate Location Services using CoreLocation API on macOS

SwiftLiverpool Description This tool leverages the CoreLocation API on macOS to enumerate Location Services data. You need to enable "Location Service

Justin Bui 4 Aug 20, 2022
An iOS pre-permissions utility that lets developers ask users on their own dialog for calendar, contacts, location, photos, reminders, twitter, push notifications and more, before making the system-based permission request.

An iOS pre-permissions utility that lets developers ask users on their own dialog for calendar, contacts, location, photos, reminders, twitter, push notifications and more, before making the system-based permission request.

Joe L 420 Dec 22, 2022
Minimalist HTTP request library via async / await

Making HTTP API requests in Swift using Foundation can be verbose and use a mix of types like URL, URLComponents and URLRequest to form a request and then handling all the encoding and decoding steps later

Nicholas Maccharoli 13 Nov 5, 2022
Use any custom view as custom callout view for MKMapView with cool animations. Use any image as annotation view.

MapViewPlus About MapViewPlus gives you the missing methods of MapKit which are: imageForAnnotation and calloutViewForAnnotationView delegate methods.

Okhan Okbay 162 Nov 16, 2022
SwiftUI wrapper for MapKit's MKMapView (UIKit).

SwiftUIMKMapView SwiftUI wrapper for MapKit's MKMapView (UIKit). ▶️ Usage Add as a dependecy to your project using Swift Package Manager. Embed map vi

Dariusz Rybicki 1 Apr 4, 2022
MKMapView wrapper for SwiftUI as drop-in to MapKit's SwiftUI view

MKMapView wrapper for SwiftUI as drop-in to MapKit's SwiftUI view. Easily extensible annotations and overlays, iOS 13 support and backwards compatible with MKAnnotation and MKOverlay!

Paul 73 Dec 26, 2022
🛰 CoreLocation Made Easy - Efficient & Easy Location Tracker, IP Location, Gecoder, Geofence, Autocomplete, Beacon Ranging, Broadcaster and Visits Monitoring

Location Manager Made Easy SwiftLocation is a lightweight Swift Library that provides an easy way to work with location-related functionalities. No mo

Daniele Margutti 3.2k Dec 30, 2022
🛰 CoreLocation Made Easy - Efficient & Easy Location Tracker, IP Location, Gecoder, Geofence, Autocomplete, Beacon Ranging, Broadcaster and Visits Monitoring

Location Manager Made Easy SwiftLocation is a lightweight Swift Library that provides an easy way to work with location-related functionalities. No mo

Daniele Margutti 3.2k Dec 30, 2022
Swifty360Player - iOS 360-degree video player streaming from an AVPlayer.

Swifty360Player iOS 360-degree video player streaming from an AVPlayer. Demo Requirements Swifty360Player Version Minimum iOS Target Swift Version 0.2

Abdullah Selek 148 Dec 18, 2022
Open Source iOS 360 Degree Panorama Video Player.

?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? The Metal with Swift 5.0 version is comming ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 360 VR Player A Open Source, Ad-free, Na

Hanton Yang 2k Dec 24, 2022
NYT360Video plays 360-degree video streamed from an AVPlayer on iOS.

NYT360Video 360º video playback from The New York Times NYT360Video plays spherical 360º video, allowing the user to explore the video via pan gesture

The New York Times 270 Nov 23, 2022
360 video player for iOS written in swift - a subset of SceneKit that works

DDDKit An open source library to support 360 videos and pictures. It's designed as a generic 3D library that you can use for much more! Example of use

Guillaume Sabran 123 Aug 9, 2022
Open Source iOS 360 Degree Panorama Video Player.

?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? The Metal with Swift 5.0 version is comming ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 360 VR Player A Open Source, Ad-free, Na

Hanton Yang 2k Jan 1, 2023
Simple 360 Video player for iOS using SceneKit

simple360player_iOS Simple 360 Video player for iOS using SceneKit. VR ready. Stereoscopic Ready. We generate a simple scene in which we add a sphere

Arthur Swiniarski 154 Nov 2, 2022
iOS 360-degree video player streaming from an AVPlayer.

Swifty360Player iOS 360-degree video player streaming from an AVPlayer. Demo Requirements Swifty360Player Version Minimum iOS Target Swift Version 0.2

Abdullah Selek 148 Dec 18, 2022
ARVideoPortal - A Minimal iOS AR app to display 360 / video in sphere space

AR Video Portal A minimal iOS AR app to display 360 / video in sphere space. Xco

Yasuhito Nagatomo 6 Jun 3, 2022