ios - Array with reference type -


array value type hence copies data.

var arrayone  = [uiview(), uiview()] var arraytwo = arrayone arrayone.first!.alpha = 0.5 arraytwo.first!.alpha // how becomes 0.5? 

but arraytwo.first!.alpha prints 0.5 not 1 please explain why?

in swift, array value type - results of arrayone copied arraytwo. however, uiview reference type, references copied. references still point original uiview why seeing behaviour.


Comments

Popular posts from this blog

minify - Minimizing css files -

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -