# Compile error in Chapter 12, page 330

**URL:** <https://forums.kodeco.com/t/compile-error-in-chapter-12-page-330/21739>\
**Category:** 2D iOS & tvOS Games by Tutorials\
**Created:** [October 26, 2016, 4:10pm UTC](https://forums.kodeco.com/t/compile-error-in-chapter-12-page-330/21739 "2016-10-26T16:10:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hssong](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/hssong/32/96780_2.png) [@hssong](https://forums.kodeco.com/u/hssong)\
**Post date:** [October 26, 2016, 4:10pm UTC](https://forums.kodeco.com/t/compile-error-in-chapter-12-page-330/21739/1 "2016-10-26T16:10:13Z")

</div>

> ```
> let xInset = min(view.bounds.width/2 * camera.xScale, background.frame.width/2)
> let yInset = min(view.bounds.height/2 * camera.yScale, background.frame.height/2)
> 
> ```

Page 330, “view” type is SKView? so. following error is displayed.

> Value of optional type ‘SKView?’ not unwrapped; did you mean to use ‘!’ or ‘?’?

So I fixed like followings

> let xInset = min(view!.bounds.width/2 \* camera.xScale, background.frame.width/2)  
> let yInset = min(view!.bounds.height/2 \* camera.yScale, background.frame.height/2)

---

<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:** [October 27, 2016, 12:11am UTC](https://forums.kodeco.com/t/compile-error-in-chapter-12-page-330/21739/2 "2016-10-27T00:11:10Z")

</div>

@hssong - I think you might have missed the second part of this line:

```
guard let camera = camera, let view = view else { return } 

```

at the top of `setupCamera()`.

That’s where the view is unwrapped.

But your change works too 🙂 - it’s just that I try and avoid `!` in code as it sometimes results in unexpected crashes.

---

<div class="post-metadata">

**Author:** ![hssong](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/hssong/32/96780_2.png) [@hssong](https://forums.kodeco.com/u/hssong)\
**Post date:** [October 27, 2016, 1:13am UTC](https://forums.kodeco.com/t/compile-error-in-chapter-12-page-330/21739/3 "2016-10-27T01:13:54Z")

</div>

Oh~ You are right!! Thanks.

That’s my mistake. I’m sorry. 🙂
