I managed to initialize CALayer using method 1, which works correctly in the rest of the code, but not in method 2. Could you tell me what is wrong.
Initialize CALayer
var layers:[CALayer]!
Method 1. Works
layers = [CALayer(), CALayer(), CALayer(), CALayer(), CALayer(), CALayer(), CALayer(), CALayer()]
Method 2. Doesn't work
layers = [CALayer](count: 8, repeatedValue: CALayer())
source
share