Kodeco Forums

CALayer Tutorial: Getting Started

Check out 10 examples of using CALayer in iOS with Swift: CAShapeLayer, CAGradientLayer, CAReplicatorLayer, and more!

This is a companion discussion topic for the original entry at https://www.raywenderlich.com/2008-calayer-tutorial-getting-started

The topic was covered with very cool and live app and a great explanation.

Thanks for such a great work :]

1 Like

You’re quite welcome and thanks for the kind words. :grinning:

Cool !
So later I would consider using Layer instead of UIImageView sometimes.

I never really dig into layer before, I learned a lot, when I download the source code and open the storyboard, omg! so many views, lol…
Thank you for this tutorial.

1 Like

Dear Scott, thank you very much indeed. You made a tutorial as it should be:

  • in detail
  • with code
  • straight forward
  • with necessary theory / context as a background
  • with a breeze of humor
  • covering broadly a single topic.

Again: Thank you very much !
Robert / Germany

1 Like

Glad you liked the tutorial, and thanks for your positive and thoughtful feedback. I really appreciate it! :smiley: The RW editorial team is amazing, and really deserves credit for ensuring the consistency and humorous tone :clap:

Hey Scott, I just checked your tutorial on CALayer. It was very good. I am stuck into the issue related to the image processing. It will be great if you can guide me.

Here is what i needs to achieve :

  • Take photo from camera or Photo gallery

  • User can manually remove background colour part of an image by moving finger over it just like an instant alpha.

Here is the reference which i am referring : GitHub - RobotsAndPencils/RPInstantAlpha: Easily allow users to remove the background from an image, just like in iWork. Its available for Mac OS. I need to implement the same for iOS Application. I have done enough r&d on it but no success.

Please give me suggestions.

thanks for your great tutorial first.

when I read about CAScrollLayer part of this tutorial, I met a problem.

it’s : in below animation, the ScrollLayer can not move at all.

 var newPoint = CGPoint(x: 250, y: 250)
UIView.animateWithDuration(0.3, delay: 0, options: .CurveEaseInOut, animations: {
  [unowned self] in
  }, completion: nil)

but if I changed the “self.scrollingViewLayer.scrollToPoint(newPoint)” to “self.scrollingViewLayer.frame.origin = newPoint” . it works…

I’m sure the scrollingViewLayer is definitely an instance of ScollLayer

thanks a lot

I know the reason, the frame of layer must be larger than the container-----wrong

I found the layer is scrolling in the view , but view’s frame is not

Great tutorial - it helped me a lot in my current project! Big thanks!

1 Like

Nice tutorial,Thank u…

1 Like