It will not compile if you use CALayer.

The project code is correct, while you forgot to change it here in article