# How does a zero rectangle cover the entire area of "selectedBackgroundView"?

**URL:** <https://forums.kodeco.com/t/how-does-a-zero-rectangle-cover-the-entire-area-of-selectedbackgroundview/18685>\
**Category:** iOS Apprentice\
**Created:** [August 19, 2016, 8:40pm UTC](https://forums.kodeco.com/t/how-does-a-zero-rectangle-cover-the-entire-area-of-selectedbackgroundview/18685 "2016-08-19T20:40:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adn](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/adn/32/68878_2.png) [@adn](https://forums.kodeco.com/u/adn)\
**Post date:** [August 19, 2016, 8:40pm UTC](https://forums.kodeco.com/t/how-does-a-zero-rectangle-cover-the-entire-area-of-selectedbackgroundview/18685/1 "2016-08-19T20:40:35Z")

</div>

> let selectedView = UIView(frame: CGRect.zero)  
> selectedView.backgroundColor = UIColor(red: 20/255, green: 160/255, blue: 160/255, alpha: 1)  
> selectedBackgroundView = selectedView

Through iOS Apprentice tutorials I came across the above block of code. How does a zero rectangle cover the entire area of a tableView cell’s background, seeing that the width and height of it is zero? Does it get scaled?

---

<div class="post-metadata">

**Author:** ![hollance](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/hollance/32/109009_2.png) [@hollance](https://forums.kodeco.com/u/hollance)\
**Post date:** [August 20, 2016, 8:40am UTC](https://forums.kodeco.com/t/how-does-a-zero-rectangle-cover-the-entire-area-of-selectedbackgroundview/18685/2 "2016-08-20T08:40:50Z")

</div>

Yes, it gets scaled automatically by the table view to cover the entire area of the cell.
