ios - swift animate all added views alpha -


i want animate views (based on tag) alpha change, getting "cannot assign alpha view" error. way this?

all views have alpha of 0 upon being added subview of mycustomview

func transitioneffects() {     uiview.animatewithduration(0.5, animations: {         view in self.mycustomview.subviews {             if(view.tag != 999) {                 view.alpha = 1             }         }     }) } 

this because swift needs know kind of objects inside subviews nsarray before sending methods.
nsarray automatically converted in swift array of anytype objects, doesn't know kind of objects extracted array. casting array array of uiviews objects should work fine.

func transitioneffects() {     uiview.animatewithduration(0.5, animations: {         view in self.mycustomview.subviews [uiview] {             if(view.tag != 999) {                 view.alpha = 1             }         }     }) } 

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -