Get Updates By E-mail 

Article Written By:
Johann Dowa

UIView Subclass Backed By CAShapeLayer That Makes Creating Custom Shapes And Animations Easier

  •  
  •  
  •  
  •  
  •  

I’ve mentioned CGPath before when I pointed out a tutorial showing how to move particle effects along a CGPath.

Conrad Kramer has created an open source library  that provides a UIView subclass backed by a CAShapeLayer so that you can easily create custom shapes and animations without needing to work directly with CAShapeLayer.

As the readme states:

CKShapeView is a UIView subclass that is backed by a CAShapeLayer.
In other words, it is a view that is capable of rendering an arbitrary CGPath.
It is completely configurable and animatable, so you can have custom drawn views without needing to subclass.
CKShapeView has all of the properties of CAShapeLayer, with the addition of a hitTestUsingPath property that allows you to hit test using the path instead of the view’s bounds.

You can find CKShapeView on Github here.

You’ll find a usage example over on the Github page.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments