# Core Graphics Tutorial Part 3: Patterns and Playgrounds

**URL:** <https://forums.kodeco.com/t/core-graphics-tutorial-part-3-patterns-and-playgrounds/6641>\
**Category:** 🎓 Courses & Articles\
**Created:** [March 4, 2016, 10:57am UTC](https://forums.kodeco.com/t/core-graphics-tutorial-part-3-patterns-and-playgrounds/6641 "2016-03-04T10:57:43Z")\
**Posts on this page:** 11\
**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, 10:57am UTC](https://forums.kodeco.com/t/core-graphics-tutorial-part-3-patterns-and-playgrounds/6641/1 "2016-03-04T10:57:43Z")

</div>

Finish your exploration of Core Graphics by learning how to draw a repeatable pattern and using Playgrounds to prototype drawing a complex image.

* * *
 This is a companion discussion topic for the original entry at [https://www.raywenderlich.com/1973-core-graphics-tutorial-part-3-patterns-and-playgrounds](https://www.raywenderlich.com/1973-core-graphics-tutorial-part-3-patterns-and-playgrounds)

---

<div class="post-metadata">

**Author:** ![jop](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jop/32/36187_2.png) [@jop](https://forums.kodeco.com/u/jop)\
**Post date:** [May 9, 2016, 8:51am UTC](https://forums.kodeco.com/t/core-graphics-tutorial-part-3-patterns-and-playgrounds/6641/2 "2016-05-09T08:51:23Z")

</div>

Hello Caroline,

Your tutorial is very helpfull for this just started App-composer.

Now I feel a bit stupid as in my MedalDrawing-playground I never see this image showing up at the place where it ought to be.  
( //This code must always be at the end of the playground )

To find out why, I downloaded your version and there I shows up indeed. Why not in my version? I can’t find the difference between yours and mine.  
Is this maybe dependent of a general setting in the playground preferences? I can’t find this.

* * *

In meantime I found the reason: you have to click at given lines this symbol ![](https://raywenderlich-com-v3-forums.s3.amazonaws.com/original/3X/5/3/53cb834b468d4716564acfb77b430ea64f4ff72c.png)  
And this is indeed also mentioned in explanation. I’ve overseen this. Sorry for that.  
Great way to explore and try out with playgrounds.

---

<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 9, 2016, 11:54pm UTC](https://forums.kodeco.com/t/core-graphics-tutorial-part-3-patterns-and-playgrounds/6641/3 "2016-05-09T23:54:29Z")

</div>

Very glad you found the answer :). Playgrounds are the best!

---

<div class="post-metadata">

**Author:** ![soggybag](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@soggybag](https://forums.kodeco.com/u/soggybag)\
**Post date:** [May 11, 2016, 5:23am UTC](https://forums.kodeco.com/t/core-graphics-tutorial-part-3-patterns-and-playgrounds/6641/4 "2016-05-11T05:23:29Z")

</div>

Great tutorials. This was a excellent series. Well explained and presents lots of useful info. Thanks!

---

<div class="post-metadata">

**Author:** ![christiansong](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/christiansong/32/42668_2.png) [@christiansong](https://forums.kodeco.com/u/christiansong)\
**Post date:** [September 27, 2016, 3:36pm UTC](https://forums.kodeco.com/t/core-graphics-tutorial-part-3-patterns-and-playgrounds/6641/6 "2016-09-27T15:36:45Z")

</div>

Hello Caroline,

Your tutorial is very GOOD!

But I found a tiny error when code it:

When copy the medaldrawing code from Playground as you write, a alert will occur – " Use of instance member ‘creatMedalImage’ on type ‘MedalView’; did you mean to use a value of type ‘MedalView’ instead?" at [lazy var medalImage:UIImage = self.createMedalImage( )]

Maybe it should use closure directly after the variant, just like : lazy var medalImage: UIImage = { // the whole draw code}( )

---

<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 27, 2016, 9:48pm UTC](https://forums.kodeco.com/t/core-graphics-tutorial-part-3-patterns-and-playgrounds/6641/7 "2016-09-27T21:48:31Z")

</div>

@christiansong - it seems to work for me. I just tried in Xcode 7.3, and didn’t get that error. Are you converting to Swift 3 or using Xcode 8?

Perhaps you could download the final code sample and compare it with yours?

---

<div class="post-metadata">

**Author:** ![therealcanadian](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/therealcanadian/32/65612_2.png) [@therealcanadian](https://forums.kodeco.com/u/therealcanadian)\
**Post date:** [December 13, 2016, 2:27am UTC](https://forums.kodeco.com/t/core-graphics-tutorial-part-3-patterns-and-playgrounds/6641/8 "2016-12-13T02:27:14Z")

</div>

Hi @caroline are there updates to Swift 3 and Xcode 8 for this Tutorial?

Great work btw! Thanks for putting this together.

---

<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:** [December 20, 2016, 8:15pm UTC](https://forums.kodeco.com/t/core-graphics-tutorial-part-3-patterns-and-playgrounds/6641/9 "2016-12-20T20:15:53Z")

</div>

@therealcanadian - sorry I didn’t see a notification.

No, sorry - there currently isn’t a Swift 3 version. I’m not sure what’s in the pipeline

---

<div class="post-metadata">

**Author:** ![swillsea](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/swillsea/32/68753_2.png) [@swillsea](https://forums.kodeco.com/u/swillsea)\
**Post date:** [May 2, 2017, 4:56am UTC](https://forums.kodeco.com/t/core-graphics-tutorial-part-3-patterns-and-playgrounds/6641/10 "2017-05-02T04:56:40Z")

</div>

I’m assuming you’ve figured it out by now, but if not - or if anyone else wants a Swift 3 version, I’ve updated the final project. It’s available here: [GitHub - swillsea/Flo\_Swift3: Flo tutorial converted to Swift 3. Original: https://www.raywenderlich.com/90690/modern-core-graphics-with-swift-part-1](https://github.com/swillsea/Flo_Swift3)

---

<div class="post-metadata">

**Author:** ![tzsh](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/tzsh/32/81494_2.png) [@tzsh](https://forums.kodeco.com/u/tzsh)\
**Post date:** [June 1, 2017, 2:49am UTC](https://forums.kodeco.com/t/core-graphics-tutorial-part-3-patterns-and-playgrounds/6641/11 "2017-06-01T02:49:50Z")

</div>

transform = transform.translatedBy(x: 15, y: 30), this x translate 15 and y translate 30 , how to calculate ?

---

<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:** [June 3, 2017, 12:20am UTC](https://forums.kodeco.com/t/core-graphics-tutorial-part-3-patterns-and-playgrounds/6641/12 "2017-06-03T00:20:56Z")

</div>

@tzsh I think I probably used trial and error to get these values.
