IOS animations course

The IOS animations course is great but here are the issues:

// From CAReplicatorLayer. Error message is “Cannot find ‘scale’ in scope”

replicatorLayer.instanceDelay = scale.duration / Double(replicatorLayer.instanceCount)

//

// From CATransaction. Error message is “Type ‘CATransition’ has no member ‘begin’”

CATransition.begin()

//

Hi Alexander,

I have notified the Administrator to have corrections made to solve the first issue you advised. The problem was that the code is supposed to be scaling the circles but had the word fade. In other words instead of:

let fade = CABasicAnimation(keyPath: "transform.scale") 
fade.fromValue = 1 
fade.toValue = 0 
fade.duration = 1.5 
fade.repeatCount = Float.infinity 

circle.add(fade, forKey: nil)

The code should have been:

let scale = CABasicAnimation(keyPath: "transform.scale")
scale.fromValue = 1
scale.toValue = 0
scale.duration = 1.5
scale.repeatCount = Float.infinity
        
circle.add(scale, forKey: nil)

I could not find the second issue you refer to. In fact I searched that CATransaction tutorial and there was no reference to Transition. Are you sure it wasn’t a typo on your part?