I have an array containing UIView subclass instances, and another array (of the same length) containing CGPoints. Without looping through the arrays, I'd like to assign the center property of each UIView subclass instance to the (index) associated CGPoint.
My first attempt looked something like UIViewArray.map {$0.center} = CGPointArray, but I quickly learned that map returns a copy of the array, so the assignment would be no good. The advice I've been able to find (e.g. this SO Q&A) only discusses using map for this sort of reassignment when the new parameter values are constant.
What's the best way to accomplish this task?
You can
zipthe two together, and mutate the UIViews with either aforloop or aforEachcall.