VanillaNAV Framework for iOS
- Sign up for a account on www.vanillanav.com
- Create an online venue using vanillaNAV Manager
Installation
CocoaPods
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
To integrate VanillaNav SDK into your Xcode project using CocoaPods, specify it in your Podfile
:
pod ‘VanillaNavFramework’, :git => "http://gitlab.rosoftlab.net/d.danilov/vanillanav-ios.git”
Then, run the following command:
$ pod install
Requirements
iOS 9.0 or later, written in Swift3.
Usage
Import the library in all files where you use it:
import VanillaNavFramework
Calling VanillaNav navigation
// Unique id of the venue generated by www.vanillanav.com
let venueId: UInt64 =
let destinationId: UInt64 = 15875
let nav = NavigationVC(venueId: venueId, destinationId: destinationId)
self.navigationController?.pushViewController(nav, animated: true)
Save location
let nav = SaveDestinationVC(venueId: venueId)
self.navigationController?.pushViewController(nav, animated: true)
SaveDestination view controller automatically dismiss when he saved destination id in memory.
Get saved location id
let id: UInt64? = SaveDestinationManager.getSavedMarkerId(forVenue: venueId)
Return nil when no location saved.
Delete saved location
SaveDestinationManager.deleteSavedMarker(forVenue: venueId)
Retrieving the list of destinations
_ = PublicApi.loadVenue(withId: venueId)
.subscribe(onNext: { (venue) in
let destinations: [Destination] = venue.destinations
}, onError: nil , onCompleted: nil, onDisposed: nil)
Retrieving the list of events
_ = PublicApi.loadVenuesList().subscribe(onNext: {
(venues: [VenueCompact]) -> Void in
//use de list of destinations
}, onError: nil
Tags: API, framework, SDK