0

I am having following scenario:

  1. There is a parent view controller which displays view A. Takes whole screen to display its content.

  2. To view A, I'm adding addSubView: ViewB. Now View B here is covering some portion of the screen partially over A, and user can see that part of view A which is not covered by view B.

  3. Now I'm trying to create a view C and want to add it to view B addSubView: ViewC, such that it overlays over view B, only to clip out a portion of View B, so that the user can see through that underlying portion of View A.

Question:

How can I go through writing properties of view C controller such that I can accomplish this clipping effect.

kishoredbn
  • 2,007
  • 4
  • 28
  • 47
  • Please share some code. Could you please also clarify clipping effect? – casillas May 12 '17 at 20:00
  • @casillas There are actually nothing I can share at this point. All I'm working with is regular UIViews and sub UIViews. My question is about an completely new feature. To be precise, I'm not stuck at any bug, which would require sharing and correcting. – kishoredbn May 12 '17 at 20:04
  • 3
    Lots of examples out there to do what you want. Start with this post: http://stackoverflow.com/questions/9711248/cut-transparent-hole-in-uiview – DonMag May 12 '17 at 20:05
  • 1
    try this http://stackoverflow.com/questions/39165751/circle-masking-for-image-cropping-in-ios/39206146#39206146 – Teja Nandamuri May 12 '17 at 20:41
  • Maybe try to use custom drawing for viewB using UIBezierPath – Zuzana Paulis May 17 '17 at 15:38
  • @TejaNandamuri I spend last couple of days implementing this solution. It is more relevant towards what I'm trying to achieve. Now the problem is that if my View has child UI elements like UIWebView, then the clipping seems not working. – kishoredbn May 17 '17 at 15:48
  • you can cover the webview with a uiview and apply the clipping! @ikis – Teja Nandamuri May 17 '17 at 15:49
  • @ZuzanaPaulis yes. I'm trying that now and seems like it's working but there are more to it which seems not working. Check my previous comments. ^ – kishoredbn May 17 '17 at 15:50
  • I use paint code app to figure out drawing. It's a great tool – Zuzana Paulis May 17 '17 at 15:57
  • @TejaNandamuri I'm towards this direction now. – kishoredbn May 17 '17 at 15:59
  • @ZuzanaPaulis thanks for your suggestion. I'll give it a try. – kishoredbn May 17 '17 at 15:59

0 Answers0