# Video Tutorial: Beginning Core Graphics Part 5: PaintCode

**URL:** <https://forums.kodeco.com/t/video-tutorial-beginning-core-graphics-part-5-paintcode/14572>\
**Category:** 🎓 Courses & Articles\
**Created:** [May 6, 2016, 4:04pm UTC](https://forums.kodeco.com/t/video-tutorial-beginning-core-graphics-part-5-paintcode/14572 "2016-05-06T16:04:04Z")\
**Posts on this page:** 8\
**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:** [May 6, 2016, 4:04pm UTC](https://forums.kodeco.com/t/video-tutorial-beginning-core-graphics-part-5-paintcode/14572/1 "2016-05-06T16:04:04Z")

</div>

Learn about PaintCode 2. We’ll draw an icon in PaintCode 2 and also use expressions to dynamically control the icon's color.

 
* * *
 This is a companion discussion topic for the original entry at [https://www.raywenderlich.com/3402-beginning-core-graphics/lessons/6](https://www.raywenderlich.com/3402-beginning-core-graphics/lessons/6)

---

<div class="post-metadata">

**Author:** ![jeremyd](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jeremyd/32/34572_2.png) [@jeremyd](https://forums.kodeco.com/u/jeremyd)\
**Post date:** [May 9, 2016, 9:21pm UTC](https://forums.kodeco.com/t/video-tutorial-beginning-core-graphics-part-5-paintcode/14572/2 "2016-05-09T21:21:16Z")

</div>

Nicely done Caroline. Very helpful and informative PaintCode tutorial. This is a huge time saver for icon creation.

---

<div class="post-metadata">

**Author:** ![dehrab](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/dehrab/32/102075_2.png) [@dehrab](https://forums.kodeco.com/u/dehrab)\
**Post date:** [May 10, 2016, 10:45am UTC](https://forums.kodeco.com/t/video-tutorial-beginning-core-graphics-part-5-paintcode/14572/3 "2016-05-10T10:45:40Z")

</div>

Hello,  
is there a way to get paint coded on discounted price?

---

<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:** [May 10, 2016, 1:42pm UTC](https://forums.kodeco.com/t/video-tutorial-beginning-core-graphics-part-5-paintcode/14572/4 "2016-05-10T13:42:06Z")

</div>

Hi dehrab - we don’t supply PaintCode. You can only purchase it from here directly:

[http://www.paintcodeapp.com](http://www.paintcodeapp.com) or from the Mac App Store:

[https://itunes.apple.com/au/app/paintcode-2/id808809998?mt=12](https://itunes.apple.com/au/app/paintcode-2/id808809998?mt=12)

---

<div class="post-metadata">

**Author:** ![jisanson](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jisanson/32/105896_2.png) [@jisanson](https://forums.kodeco.com/u/jisanson)\
**Post date:** [September 19, 2016, 8:29pm UTC](https://forums.kodeco.com/t/video-tutorial-beginning-core-graphics-part-5-paintcode/14572/5 "2016-09-19T20:29:35Z")

</div>

Hi thanks for the great tutorial. As I was following the PaintCode episode, I encountered two problems (related to the 11:00 part of the video). Here’s the first one:

 ![](https://raywenderlich-com-v3-forums.s3.amazonaws.com/original/3X/0/9/090f2ea2aded9484fcea57cbbd94089f3f87fb49.png)

I assume that my error appears because PaintCode’s codes are not ready for Swift 3, Xcode 8.0 on macOS Sierra v10.12 (which I am using). Would you have any suggestion on how I can fix the problem?

---

<div class="post-metadata">

**Author:** ![jisanson](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jisanson/32/105896_2.png) [@jisanson](https://forums.kodeco.com/u/jisanson)\
**Post date:** [September 19, 2016, 8:30pm UTC](https://forums.kodeco.com/t/video-tutorial-beginning-core-graphics-part-5-paintcode/14572/6 "2016-09-19T20:30:16Z")

</div>

Attaching the screen shot of the second problem…

![](https://raywenderlich-com-v3-forums.s3.amazonaws.com/original/3X/4/f/4fca81b6c0ee8bd43a8156fcb91e1ca898744015.png)

---

<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:** [September 19, 2016, 11:55pm UTC](https://forums.kodeco.com/t/video-tutorial-beginning-core-graphics-part-5-paintcode/14572/7 "2016-09-19T23:55:50Z")

</div>

Unfortunately Swift 3 broke a large number of things, and you’re very brave to be tackling this in Swift 3.

It’s not obvious why your first one shows an error. You could try replacing all uses of `public class` in Icons.swift to `open class`. But I’m not hopeful.

Your second problem is a Swift annoyance where the expression needs to be broken up. Something like:

```auto
    //// Group
    //// Wheel 1 Drawing
    var x = group.minX + floor(group.width * 0.11934 - 0.04) + 0.54
    var y = group.minY + floor(group.height * 0.71795) + 0.5
    var width = floor(group.width * 0.35231 - 0.04) - floor(group.width * 0.11934 - 0.04)
    var height = floor(group.height * 0.99829) - floor(group.height * 0.71795)
    let wheel1Path = UIBezierPath(ovalIn: CGRect(x: x, y: y, width: width, height: height))

```

If your first problem isn’t fixed, I would suggest taking the provided final project and converting it to Swift 3. This is really easy if you do the following.

If you open the downloaded project and straight away blithely convert it to Swift 3, you will probably get a mountain of errors.

However, open the untouched downloaded project, and when it asks you to convert, click Later twice. Now change your team signing in General settings from None to your team. Quit Xcode.

This time when you open the project, click Convert and then Convert to Swift 3 and Next and Next. Xcode will generate a preview. Save this. Everything should be converted properly and you can compare your code to the new Swift 3 code.

You will still get your second error which you can fix as I suggested above.

I don’t know why the project takes such a long time to build.

---

<div class="post-metadata">

**Author:** ![jisanson](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jisanson/32/105896_2.png) [@jisanson](https://forums.kodeco.com/u/jisanson)\
**Post date:** [September 26, 2016, 2:13pm UTC](https://forums.kodeco.com/t/video-tutorial-beginning-core-graphics-part-5-paintcode/14572/8 "2016-09-26T14:13:18Z")

</div>

It seems to work now. Thanks so much!
