1

I want to make irregular shaped UIScrollView(using CGPath or UIBezierPath).

The contents will be scrollable and zoomable. And scroll actions will be accepted only in these areas, not rectangular area. Any ideas?

vikingosegundo
  • 52,040
  • 14
  • 137
  • 178
Jun
  • 3,422
  • 3
  • 28
  • 58

1 Answers1

3

Your could use a CAShapedLayer with a path to create a clipping path and apply this to the Scrollview's layer's mask. Use the same path in the view's hitTest:withEvent: to decide, if the UIView should response to a touch or not.

rdelmar
  • 103,982
  • 12
  • 207
  • 218
vikingosegundo
  • 52,040
  • 14
  • 137
  • 178