let parameters = [
"access_token": access_token,
]
self.alamoFireManager!.request(.POST, CONSTANTS.APIEndpoint+"/auth", parameters: parameters).responseJSON { [unowned self]
response in
self.startWorking()
}
Do I need unowned self inside the closure, or is it already taken care of by the library?
Use Alamofire.request
instead of self.alamoFireManager
and you are good to go without capturing self. If you really need to use self.alamoFireManager
, as @Tapani mentioned, since alamoFireManager
is a property of self, you need to capture self and use [weak self] in the closure
I was looking for the same answer you were looking for. I've found this answer. It mentions about an article about retain cycles. I think you don't need to capture self here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With