SITLocationManager
Objective-C
@interface SITLocationManager : NSObject <SITLocationInterface>
Swift
class SITLocationManager : NSObject, SITLocationInterface
SITLocationManager The SITLocationManager class is the central point for configuring the delivery of location- and headind related events to your app. You use the shared instance of this class to establish the parameters that determine when location and heading events should be delivered and to start and stop the actual delivery of those events.
Set the desired delegates to listen for location updates.
Note
This class needs bluetooth information to do its work. In case bluetooth access is off, or permissions are denied, an error will be returned to the delegate. It can be thrown at the initial checking or at any moment during the positioning.-
Singleton instance
Note
You should always use this method to obtain the manager object and should not try to create instances directlyDeclaration
Objective-C
+ (instancetype _Nonnull)sharedInstance;
Swift
class func sharedInstance() -> Self
Return Value
An initialized object
-
Deprecated
Use
-[SITLocationManager addDelegate:]
and-[SITLocationManager removeDelegate:]
insteadObject that conforms to the SITLocationDelegate Protocol
Declaration
Objective-C
@property (nonatomic, weak) id<SITLocationDelegate> _Nullable delegate;
Swift
weak var delegate: SITLocationDelegate? { get set }
-
Object that conforms to the SITGeofencesDelegate Protocol where notifications about the user entering or exiting a geofence are notified
Declaration
Objective-C
@property (nonatomic, weak) id<SITGeofencesDelegate> _Nullable geofenceDelegate;
Swift
weak var geofenceDelegate: SITGeofencesDelegate? { get set }
-
Add delegate to listen for location updates.
Note
you can call-[SITLocationManager removeDelegate:]
if you wish to stop receiving notifications in that specific delegate. If the delegate is going to be released from memory you must call-[SITLocationManager removeDelegate:]
as well to avoid SitumSDK to retain the delegate in memoryDeclaration
Objective-C
- (void)addDelegate:(id<SITLocationDelegate> _Nonnull)delegate;
Swift
func addDelegate(_ delegate: SITLocationDelegate)
-
Remove delegate to listen for location updates.
Declaration
Objective-C
- (void)removeDelegate:(id<SITLocationDelegate> _Nonnull)delegate;
Swift
func removeDelegate(_ delegate: SITLocationDelegate)