Hey I want to create a set game app, and now I want my cards(UIViews) move to a newPosition. after the animation ended I want this view to remove from super view
func btnUp(card: CardSubview, frame: CGRect) {
let newPosition = CGRect(x: (self.superview?.frame.minX)!, y: (self.superview?.frame.maxY)!, width: card.bounds.width, height: card.bounds.height)
//UIView.animate(withDuration: 3.0, animations: {card.frame = newPosition})
UIView.animate(withDuration: 3.0, animations: {card.frame = newPosition}, completion: {if card.frame == newPosition {card.removeFromSuperview()}})
}
this is working but If I want to add a completion I get this error:
Cannot convert value of type '() -> ()' to expected argument type '((Bool) -> Void)?'**
so what am I doin wrong ?