UIView.animateWithDuration(1,
animations: { [unowned self] in
self.box.center = self.boxTopRightPosition
},
completion: { [unowned self] completed in
self.box.hidden = true
})
Is it necessary to avoid memory leak?
No, it is not needed in this case.
animations
andcompletion
are not retained byself
so there is no risk of strong retain cycle.