Closed agordeev closed 8 years ago
Hi, yes, I agree, which part of code are you referring to?
README
I would not put the capture list to this example in the readme, which currently is:
// Receive user input
cosmosView.didTouchCosmos = { rating in }
In my opinion, putting capture list will make the example a little bit complicated and move the focus away from its main purpose. Remember, we are not teaching people Swift language here, but rather explaining how to use the library. Note that in some situation people will not need to use capture list at all, or they will need to use [weak self]
instead of [unowned self]
. Explaining all those nuances in this readme is a bit out of the scope of this document and could be distractive. Thank you for your feedback.
I'd be safer to change this
to this
in case if we'd use this code within view controller. Otherwise
didTouchCosmos
closure captures a reference toself
and retain cycle is created.