All Projects → SvenTiigi → Stlocationrequest

SvenTiigi / Stlocationrequest

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

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Stlocationrequest

Sidemenu
Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less.
Stars: ✭ 5,267 (+728.14%)
Mutual labels:  cocoapods, carthage
Jlroutes
URL routing library for iOS with a simple block-based API
Stars: ✭ 5,528 (+769.18%)
Mutual labels:  cocoapods, carthage
Bow
🏹 Bow is a cross-platform library for Typed Functional Programming in Swift
Stars: ✭ 538 (-15.41%)
Mutual labels:  cocoapods, carthage
Multiprogressview
📊 An animatable view that depicts multiple progresses over time. Modeled after UIProgressView
Stars: ✭ 614 (-3.46%)
Mutual labels:  cocoapods, carthage
Haptica
Easy Haptic Feedback Generator 📳
Stars: ✭ 587 (-7.7%)
Mutual labels:  cocoapods, carthage
Swiftframeworktemplate
A template for new Swift iOS / macOS / tvOS / watchOS Framework project ready with travis-ci, cocoapods, Carthage, SwiftPM and a Readme file
Stars: ✭ 527 (-17.14%)
Mutual labels:  cocoapods, carthage
Gradientview
Easily use gradients in UIKit for iOS & tvOS
Stars: ✭ 610 (-4.09%)
Mutual labels:  cocoapods, carthage
Watchdoginspector
Shows your current framerate (fps) in the status bar of your iOS app
Stars: ✭ 497 (-21.86%)
Mutual labels:  cocoapods, carthage
Kydrawercontroller
Side Drawer Navigation Controller similar to Android
Stars: ✭ 632 (-0.63%)
Mutual labels:  cocoapods, carthage
Sdwebimage
Asynchronous image downloader with cache support as a UIImageView category
Stars: ✭ 23,928 (+3662.26%)
Mutual labels:  cocoapods, carthage
Anim
Swift animation library for iOS, tvOS and macOS.
Stars: ✭ 520 (-18.24%)
Mutual labels:  cocoapods, carthage
Pdfgenerator
A simple generator of PDF written in Swift.
Stars: ✭ 629 (-1.1%)
Mutual labels:  cocoapods, carthage
Openssl
OpenSSL package for SPM, CocoaPod, and Carthage, for iOS and macOS
Stars: ✭ 515 (-19.03%)
Mutual labels:  cocoapods, carthage
Orsserialport
Serial port library for Objective-C and Swift macOS apps
Stars: ✭ 609 (-4.25%)
Mutual labels:  cocoapods, carthage
Keyboardshortcuts
Add user-customizable global keyboard shortcuts to your macOS app in minutes
Stars: ✭ 500 (-21.38%)
Mutual labels:  cocoapods, carthage
Swiftinstagram
Instagram API client written in Swift
Stars: ✭ 570 (-10.38%)
Mutual labels:  cocoapods, carthage
Googlereporter
Easily integrate with Google Analytics in your iOS app
Stars: ✭ 479 (-24.69%)
Mutual labels:  cocoapods, carthage
Youtubekit
YoutubeKit is a video player that fully supports Youtube IFrame API and YoutubeDataAPI for easily create a Youtube app
Stars: ✭ 484 (-23.9%)
Mutual labels:  cocoapods, carthage
Sablurimageview
You can use blur effect and it's animation easily to call only two methods.
Stars: ✭ 538 (-15.41%)
Mutual labels:  cocoapods, carthage
Urlembeddedview
URLEmbeddedView automatically caches the object that is confirmed the Open Graph Protocol.
Stars: ✭ 633 (-0.47%)
Mutual labels:  cocoapods, carthage

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].