swift - How to animate the alpha of a textLabel in UITableView? -
swift - How to animate the alpha of a textLabel in UITableView? -
hey guys trying alter alpha of default taxtlabel uitableview when table scrolled getting error:
cannot invoke 'animatewithduration' argument list of type '(floatliteralconvertible, animations: () -> () -> $t2)' my code this:
override func scrollviewdidscroll(scrollview: uiscrollview) { cell in tableview.visiblecells() { uiview.animatewithduration(0.5, animations: { cell.textlabel??.alpha = 0.0 }) } }
add empty return statement @ end of closure
uiview.animatewithduration(0.5, animations: { cell.textlabel??.alpha = 0.0 homecoming // <== add together }) you using compact (shortened) closure version, has implicit return. happens code read compiler as:
return cell.textlabel??.alpha = 0.0 and doesn't match closure signature, hence compilation error. adding homecoming statement makes explicit closure has no homecoming value.
swift ios8 uiviewanimation
Comments
Post a Comment