# MyLocations - Color Format

**URL:** <https://forums.kodeco.com/t/mylocations-color-format/31193>\
**Category:** iOS Apprentice\
**Created:** [June 21, 2017, 12:41pm UTC](https://forums.kodeco.com/t/mylocations-color-format/31193 "2017-06-21T12:41:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdelatorre312](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jdelatorre312/32/68768_2.png) [@jdelatorre312](https://forums.kodeco.com/u/jdelatorre312)\
**Post date:** [June 21, 2017, 12:41pm UTC](https://forums.kodeco.com/t/mylocations-color-format/31193/1 "2017-06-21T12:41:11Z")

</div>

Hi,

Sorry if this has been asked before, I’m a total newbie. I’m going through the MyLocations iOS Apprentice Book when I noticed on page 264, that there are times when setting colors we are using ‘UIColor.black’ and sometimes we are just using ‘.black’. Are these interchangeable?

---

<div class="post-metadata">

**Author:** ![narrativium](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/narrativium/32/110937_2.png) [@narrativium](https://forums.kodeco.com/u/narrativium)\
**Post date:** [June 21, 2017, 3:28pm UTC](https://forums.kodeco.com/t/mylocations-color-format/31193/2 "2017-06-21T15:28:55Z")

</div>

In this context, I think they’re interchangeable. The fields you’re setting (e.g. `tableView.backgroundColor`) are known to be of type `UIColor`, so Swift can infer that `.black` is short for `UIColor.black`.

In other contexts, Swift might not able to infer a type so easily, so you’ll need to be explicit and type `UIColor` in.

---

<div class="post-metadata">

**Author:** ![jdelatorre312](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jdelatorre312/32/68768_2.png) [@jdelatorre312](https://forums.kodeco.com/u/jdelatorre312)\
**Post date:** [June 23, 2017, 10:28am UTC](https://forums.kodeco.com/t/mylocations-color-format/31193/3 "2017-06-23T10:28:35Z")

</div>

Ok, thanks for the explanation. Appreciate the help.
