# Chapter 14: Animations mistake

**URL:** <https://forums.kodeco.com/t/chapter-14-animations-mistake/93894>\
**Category:** SwiftUI by Tutorials\
**Created:** [January 8, 2020, 10:38am UTC](https://forums.kodeco.com/t/chapter-14-animations-mistake/93894 "2020-01-08T10:38:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![d9rad](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/d9rad/32/81494_2.png) [@d9rad](https://forums.kodeco.com/u/d9rad)\
**Post date:** [January 8, 2020, 10:38am UTC](https://forums.kodeco.com/t/chapter-14-animations-mistake/93894/1 "2020-01-08T10:38:48Z")

</div>

I’m going through the part in chapter 14 where we try to animate the flight details by manipulating the offset (page 482 on the epub):

```
if showDetails {
        FlightDetails(flight: flight)
          .offset(x: showDetails ? 0 : -UIScreen.main.bounds.width)
}

```

This won’t actually work because of the `if` statement. It will still ad or remove the view based on that condition and ignore any of the animation modifiers added after `offset(...)`.

Instead we should remove the `if` and just keep:

```
FlightDetails(flight: flight)
          .offset(x: showDetails ? 0 : -UIScreen.main.bounds.width)

```

Any animation modifiers added after `offset(...)` will now work properly.

---

<div class="post-metadata">

**Author:** ![bmorefield](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/bmorefield/32/111506_2.png) [@bmorefield](https://forums.kodeco.com/u/bmorefield)\
**Post date:** [January 11, 2020, 3:49pm UTC](https://forums.kodeco.com/t/chapter-14-animations-mistake/93894/2 "2020-01-11T15:49:35Z")

</div>

Hey @d9rad. You’re correct that the conditional should be removed when using the offset. This typo was corrected in the latest version of the book. Check the store and you should be able to download the update with this and a number of other corrections.
