# Video Tutorial: CALayers Part 4: Conclusion

**URL:** <https://forums.kodeco.com/t/video-tutorial-calayers-part-4-conclusion/7479>\
**Category:** 🎓 Courses & Articles\
**Created:** [March 4, 2016, 9:24pm UTC](https://forums.kodeco.com/t/video-tutorial-calayers-part-4-conclusion/7479 "2016-03-04T21:24:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![caroline](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/caroline/32/111867_2.png) [@caroline](https://forums.kodeco.com/u/caroline)\
**Post date:** [March 4, 2016, 9:24pm UTC](https://forums.kodeco.com/t/video-tutorial-calayers-part-4-conclusion/7479/1 "2016-03-04T21:24:58Z")

</div>

Learn how to mask CALayers and then review what you've learned in the CALayers video tutorial series.

 
* * *
 This is a companion discussion topic for the original entry at [https://www.raywenderlich.com/3246-calayers/lessons/5](https://www.raywenderlich.com/3246-calayers/lessons/5)

---

<div class="post-metadata">

**Author:** ![mergesort](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/mergesort/32/94922_2.png) [@mergesort](https://forums.kodeco.com/u/mergesort)\
**Post date:** [March 25, 2016, 12:07am UTC](https://forums.kodeco.com/t/video-tutorial-calayers-part-4-conclusion/7479/2 "2016-03-25T00:07:27Z")

</div>

Great lecturer, very clear.

---

<div class="post-metadata">

**Author:** ![zarzonis](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/zarzonis/32/94791_2.png) [@zarzonis](https://forums.kodeco.com/u/zarzonis)\
**Post date:** [May 5, 2016, 10:27am UTC](https://forums.kodeco.com/t/video-tutorial-calayers-part-4-conclusion/7479/3 "2016-05-05T10:27:39Z")

</div>

Awesome video series on CALayers. Thank your very much Caroline!

---

<div class="post-metadata">

**Author:** ![vladyslavv8](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/vladyslavv8/32/102075_2.png) [@vladyslavv8](https://forums.kodeco.com/u/vladyslavv8)\
**Post date:** [July 25, 2016, 3:08pm UTC](https://forums.kodeco.com/t/video-tutorial-calayers-part-4-conclusion/7479/4 "2016-07-25T15:08:58Z")

</div>

Amazing course, everything clear.

---

<div class="post-metadata">

**Author:** ![jcatterwaul](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jcatterwaul/32/94210_2.png) [@jcatterwaul](https://forums.kodeco.com/u/jcatterwaul)\
**Post date:** [November 19, 2016, 4:24am UTC](https://forums.kodeco.com/t/video-tutorial-calayers-part-4-conclusion/7479/5 "2016-11-19T04:24:37Z")

</div>

I like that you have a distinction in this series between code that’s intended to run once, late in one of the multiple initializers: `setup`, and other code that will run multiple times: `configure`. Are you still using this convention? Although it’s a common pattern, I haven’t seen consensus on what people call these types of functions.

---

<div class="post-metadata">

**Author:** ![caroline](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/caroline/32/111867_2.png) [@caroline](https://forums.kodeco.com/u/caroline)\
**Post date:** [November 19, 2016, 7:15am UTC](https://forums.kodeco.com/t/video-tutorial-calayers-part-4-conclusion/7479/6 "2016-11-19T07:15:30Z")

</div>

@jcatterwaul - I like that you pick up on these things. I tend to look at results and code readability primarily and secondly the structure of how we got there. So when you ask a question on why it’s called `setup` - I would call it that because that’s what it does. I haven’t thought about a convention. But I would like there to be one, so that I can use it consistently.

I think that `setup` and `configure` are a good way to go with this. Ray originally did this series, and that naming convention is quite probably what he had in mind. So let’s run with it?

---

<div class="post-metadata">

**Author:** ![muh\_azharudheen](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/muh_azharudheen/32/75277_2.png) [@muh\_azharudheen](https://forums.kodeco.com/u/muh_azharudheen)\
**Post date:** [October 29, 2017, 1:10pm UTC](https://forums.kodeco.com/t/video-tutorial-calayers-part-4-conclusion/7479/7 "2017-10-29T13:10:33Z")

</div>

Thank you for the great lecture… 🙂 …,

---

<div class="post-metadata">

**Author:** ![ys\_xs](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/ys_xs/32/105896_2.png) [@ys\_xs](https://forums.kodeco.com/u/ys_xs)\
**Post date:** [March 5, 2018, 9:06am UTC](https://forums.kodeco.com/t/video-tutorial-calayers-part-4-conclusion/7479/8 "2018-03-05T09:06:51Z")

</div>

@caroline After learning all this videos, I have some questions, As we all know, code like below will cause off-screen rendered.

```swift
imageView.layer.cornerRadius = CGRectGetHeight(imageView.bounds)/2.0
imageView.layer.masksToBounds = true

```

so

1. what is the best practice of circular view or image ? and if there is no best practice, could you give me some strategies and when to use them.
2. what is off-screen rendered and why using `masksToBounds` will cause off-screen rendered, could you explain all of these ?

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [March 5, 2018, 9:41am UTC](https://forums.kodeco.com/t/video-tutorial-calayers-part-4-conclusion/7479/9 "2018-03-05T09:41:13Z")

</div>

@caroline Can you please help with this when you get a chance? Thank you - much appreciated! :]

---

<div class="post-metadata">

**Author:** ![caroline](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/caroline/32/111867_2.png) [@caroline](https://forums.kodeco.com/u/caroline)\
**Post date:** [March 7, 2018, 2:07am UTC](https://forums.kodeco.com/t/video-tutorial-calayers-part-4-conclusion/7479/10 "2018-03-07T02:07:25Z")

</div>

1. Corner radius is great for single images. If you have a table view, and it slows down, then I would recommend drawing the image in a circle using Core Graphics. However, it all depends on exactly what you are doing, and I wouldn’t recommend optimizing until you find that it is necessary. As devices get faster, it becomes less important.
2. There’s an excellent article explaining off-screen rendering here: [Getting Pixels onto the Screen · objc.io](https://www.objc.io/issues/3-views/moving-pixels-onto-the-screen/#offscreen-rendering). The primary objective is to get pixels onto the screen as quickly as possible, but when you use transparency or masking, the layer has to be composed off screen.  
For example, render objects A B and C. If all the objects are opaque, that’s a simple operation, and A might be behind B and C. If B has a mask or transparency, then the GPU has to work out which pixels should be partially or completely rendered, so everything gets taken off direct rendering to the screen in case it’s too complex to be rendered quickly, leading to flickering.
