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
Post a Comment