Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 1.32 KB | None | 0 0
  1.  
  2. class CaruselleScreenInteractor: AWSDKMatchmakerDelegate, AWSDKVisitDelegate  {
  3.  
  4. }
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12. That gives us the ability to extend some functions in our classes regarding the visit error handling
  13.  
  14.  
  15.  
  16. class CaruselleScreenInteractor: AWSDKMatchmakerDelegate, AWSDKVisitDelegate  {
  17.  
  18.    
  19.  
  20.     func providerListExhausted() {
  21.  
  22.         print ("providerListExhausted")
  23.  
  24.     }
  25.  
  26.    
  27.  
  28.     func matchmakerFailedWithError(_ error: Error?) {
  29.  
  30.         print ("matchmakerFailedWithError")
  31.  
  32.     }
  33.  
  34.  
  35.  
  36.     func visitUpdateDidFail (_ error: Error?) {
  37.  
  38.         print ("visitUpdateDidFail ")
  39.  
  40.     }
  41.  
  42. }
  43.  
  44. //We attach the delegates in our callbacks, the MatchmakerDelegate in the startMatchmakerServiceWithVisit:
  45.  
  46. AWSDKVisitService.startMatchmakerServiceWithVisit(visit: visit, delegate: self as AWSDKMatchmakerDelegate, completion: { (success, error) in
  47.  
  48.             guard error == nil else {
  49.  
  50.                 self.carusellePresenter?.onError(message: error?.localizedDescription ?? GlobalSDK.onNilError)
  51.  
  52.                 return
  53.  
  54.             }
  55.             guard success else {
  56.  
  57.  
  58.  
  59.                 self.carusellePresenter?.onError(message: error?.localizedDescription ?? GlobalSDK.onErrorInitlizingVisit)
  60.  
  61.                 return
  62.  
  63.             }
  64.  
  65.            
  66.  
  67.         })
  68.  
  69.  
  70. getVisit().delegate = self
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement