Read Copy on Write in iOS 11
On last job interview when we discussed Swift, interviewer said that recently copy-on-write was implemenented for Foundation classes like NSMutableArray
. I was surprised. Missed this somehow. That is why I googled for and came accross post Copy on Write in iOS 11. So, NSMutableArray *ar2 = [ar1 mutableCopy];
doesn’t make copy. Actual copying will be done on first change to copied array. That’s good that Swift makes Objective-C stronger.