//
//  ResetPasswordOperation.swift
//  TOZ_iOS
//
//  Copyright © 2017 intive. All rights reserved.
//

import Foundation

class ResetPasswordOperation: ServiceOperation {

    private let request: ResetPasswordRequest
    var resultCompletion: ((_ success: Bool) -> ())?


    init(email: String) {
        request = ResetPasswordRequest(email: email)
        super.init()
    }

    func start(completion: ((_ success: Bool)->())?) {
        self.resultCompletion = completion
        service.request(request, completion: handleResponse)
    }

    private func handleResponse(_ response: RequestResult<AnyObject>) {
        switch response {
        case .success:
            resultCompletion?(true)
            return
        case .failure:
            resultCompletion?(false)
        }
    }

}

//
//  ResetPasswordOperation.swift
//  TOZ_iOS
//
//  Copyright © 2017 intive. All rights reserved.
//

import Foundation

class ResetPasswordOperation: ServiceOperation {

    private let request: ResetPasswordRequest

    init(email: String) {
        request = ResetPasswordRequest(email: email)
        super.init()
    }

    func start() {
        service.request(request, completion: handleResponse)
    }

    private func handleResponse(_ response: RequestResult<AnyObject>) {
        switch response {
        case .success: return
        case .failure: print ("error")
        }
    }

}

--- 
+++ 
@@ -10,20 +10,26 @@
 class ResetPasswordOperation: ServiceOperation {
 
     private let request: ResetPasswordRequest
+    var resultCompletion: ((_ success: Bool) -> ())?
+
 
     init(email: String) {
         request = ResetPasswordRequest(email: email)
         super.init()
     }
 
-    func start() {
+    func start(completion: ((_ success: Bool)->())?) {
+        self.resultCompletion = completion
         service.request(request, completion: handleResponse)
     }
 
     private func handleResponse(_ response: RequestResult<AnyObject>) {
         switch response {
-        case .success: return
-        case .failure: print ("error")
+        case .success:
+            resultCompletion?(true)
+            return
+        case .failure:
+            resultCompletion?(false)
         }
     }
 
Return information if request was sent succesfull
