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

php - Embed BBCode within itself not working -

three.js - how to load gltf in three JS -

sql server - T-SQL: Access DB objects in same schema without qualifying? -