All pages
Powered by GitBook
1 of 1

Loading...

Work location

Get work location

//importing the framework
import GeoUniq

...

let work: GUWorkLocation? = GeoUniq.sharedInstance().getWorkLocation()

...
//importing the framework
#import "GeoUniq/GeoUniq-Swift.h"
...

GUHomeLocation* home = [[GeoUniq sharedInstance] getWorkLocation];

...

Set work location listener

//importing the framework
import GeoUniq

...

GeoUniq.sharedInstance().setWorkLocationListener(listener: ClassTest)

...
//importing the framework
#import "GeoUniq/GeoUniq-Swift.h"
...

[[GeoUniq sharedInstance] setWorkLocationListenerWithListener:[ClassTest class]];

...

where ClassTest is conform to protocol GUWorkLocationListener:

/**
 *  Delegate to implement in order to receive callbacks for the work location updates
 */
@objc public protocol GUWorkLocationListener {
	
	/**
	 Public constructor
	 */
	@objc init()
	
	/**
	 Called when a new work location is detected
	 
	 - parameter work: Work location detected
	 */
	@objc func onNewWorkLocationDetected(work: GUWorkLocation) -> ()
}

Remove work location listener

//importing the framework
import GeoUniq

...

GeoUniq.sharedInstance().removeWorkLocationListener(listener: ClassTest)

...
//importing the framework
#import "GeoUniq/GeoUniq-Swift.h"
...

[[GeoUniq sharedInstance] removeWorkLocationListenerWithListener:[ClassTest class]];

...

Get work location listeners

//importing the framework
import GeoUniq

...

let workLocationListeners: [GUWorkLocation]? = GeoUniq.sharedInstance().getWorkLocationListeners()

...
//importing the framework
#import "GeoUniq/GeoUniq-Swift.h"
...

NSArray *listeners = [[GeoUniq sharedInstance] getWorkLocationListeners];

...

Remove work location listeners

//importing the framework
import GeoUniq

...

GeoUniq.sharedInstance().removeWorkLocationListeners()

...
//importing the framework
#import "GeoUniq/GeoUniq-Swift.h"
...

[[GeoUniq sharedInstance] removeWorkLocationListeners];

...