Offline
public class Offline : NSObject
Class to manage offline hits stored
-
Send all hits stored
Declaration
Swift
@objc public func dispatch()
-
Get all offline hits stored in database
Declaration
Swift
@objc public func get() -> [Hit]
Return Value
collection of offline hits
-
Get the number of offline hits stored in database
Declaration
Swift
@objc public func count() -> Int
Return Value
number of offline hits
-
Delete all offline hits stored in database
Declaration
Swift
@objc public func delete() -> Int
Return Value
number of deleted hits (-1 if an error occured)
-
Delete offline hits older than the number of days passed in parameter
Declaration
Swift
@objc(deleteOlderThanInt:) public func delete(_ olderThan: Int) -> Int
Parameters
olderThan
Number of days of offline hits to keep in database
Return Value
number of deleted hits (-1 if an error occured)
-
Delete offline hits older than the date passed in parameter
Declaration
Swift
@objc(deleteOlderThanDate:) public func delete(_ olderThan: Date) -> Int
Parameters
olderThan
Date from which the hits will be deleted
Return Value
number of deleted hits (-1 if an error occured)
-
Get the first hit stored in database
Declaration
Swift
@objc public func oldest() -> Hit?
Return Value
the oldest hit
-
Get the latest hit stored in database
Declaration
Swift
@objc public func latest() -> Hit?
Return Value
the latest hit