OfflineRequestManagerDelegate
protocol OfflineRequestManagerDelegate : AnyObject
Protocol for receiving callbacaks from OfflineRequestManager and reconfiguring a new OfflineRequestManager from dictionaries saved to disk in the case of previous requests that never completed
-
offlineRequest(withDictionary:)Default implementationMethod that the delegate uses to generate OfflineRequest objects from dictionaries written to disk
Default Implementation
Declaration
Swift
func offlineRequest(withDictionary dictionary: [String : Any]) -> OfflineRequest?Parameters
dictionarydictionary saved to disk associated with an unfinished request
Return Value
OfflineRequest object to be queued
-
offlineRequestManager(_:didUpdateProgress:)Default implementationCallback indicating the OfflineRequestManager’s current progress
Default Implementation
Declaration
Swift
func offlineRequestManager(_ manager: OfflineRequestManager, didUpdateProgress progress: Double)Parameters
managerOfflineRequestManager instance
progresscurrent progress for all ongoing requests (ranges from 0 to 1)
-
offlineRequestManager(_:didUpdateConnectionStatus:)Default implementationCallback indicating the OfflineRequestManager’s current connection status
Default Implementation
Declaration
Swift
func offlineRequestManager(_ manager: OfflineRequestManager, didUpdateConnectionStatus connected: Bool)Parameters
managerOfflineRequestManager instance
connectedvalue indicating whether there is currently connectivity
-
offlineRequestManager(_:shouldAttemptRequest:)Default implementationCallback that can be used to block a request attempt
- manager: OfflineRequestManager instance
- request: OfflineRequest to be performed
Default Implementation
Declaration
Swift
func offlineRequestManager(_ manager: OfflineRequestManager, shouldAttemptRequest request: OfflineRequest) -> BoolReturn Value
value indicating whether the OfflineRequestManager should move forward with the request attempt
-
offlineRequestManager(_:shouldReattemptRequest:withError:)Default implementationCallback to reconfigure and reattempt an OfflineRequest after a failure not related to connectivity issues
Default Implementation
Declaration
Swift
func offlineRequestManager(_ manager: OfflineRequestManager, shouldReattemptRequest request: OfflineRequest, withError error: Error) -> BoolParameters
managerOfflineRequestManager instance
requestOfflineRequest that failed
errorNSError associated with the failure
Return Value
value indicating whether the OfflineRequestManager should reattempt the OfflineRequest action
-
offlineRequestManager(_:didStartRequest:)Default implementationCallback indicating that the OfflineRequest action has started
Default Implementation
Declaration
Swift
func offlineRequestManager(_ manager: OfflineRequestManager, didStartRequest request: OfflineRequest)Parameters
managerOfflineRequestManager instance
requestOfflineRequest that started its action
-
Callback indicating that the OfflineRequest status has changed
Declaration
Swift
func offlineRequestManager(_ manager: OfflineRequestManager, didUpdateRequest request: OfflineRequest)Parameters
managerOfflineRequestManager instance
requestOfflineRequest that changed its subtitle
-
offlineRequestManager(_:didFinishRequest:)Default implementationCallback indicating that the OfflineRequest action has successfully finished
Default Implementation
Declaration
Swift
func offlineRequestManager(_ manager: OfflineRequestManager, didFinishRequest request: OfflineRequest)Parameters
managerOfflineRequestManager instance
requestOfflineRequest that finished its action
-
offlineRequestManager(_:requestDidFail:withError:)Default implementationCallback indicating that the OfflineRequest action has failed for reasons unrelated to connectivity
Default Implementation
Declaration
Swift
func offlineRequestManager(_ manager: OfflineRequestManager, requestDidFail request: OfflineRequest, withError error: Error)Parameters
managerOfflineRequestManager instance
requestOfflineRequest that failed
errorNSError associated with the failure
View on GitHub
OfflineRequestManagerDelegate Protocol Reference