# Your Second iOS and SwiftUI App · Edit Mode | raywenderlich.com

**URL:** <https://forums.kodeco.com/t/your-second-ios-and-swiftui-app-edit-mode-raywenderlich-com/84882>\
**Category:** 🎓 Courses & Articles\
**Created:** [October 13, 2019, 10:28pm UTC](https://forums.kodeco.com/t/your-second-ios-and-swiftui-app-edit-mode-raywenderlich-com/84882 "2019-10-13T22:28:45Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jessycatterwaul](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jessycatterwaul/32/110937_2.png) [@jessycatterwaul](https://forums.kodeco.com/u/jessycatterwaul)\
**Post date:** [October 13, 2019, 10:28pm UTC](https://forums.kodeco.com/t/your-second-ios-and-swiftui-app-edit-mode-raywenderlich-com/84882/1 "2019-10-13T22:28:46Z")

</div>

* * *
This is a companion discussion topic for the original entry at [https://www.raywenderlich.com/5662524-your-second-ios-and-swiftui-app/lessons/15](https://www.raywenderlich.com/5662524-your-second-ios-and-swiftui-app/lessons/15)

---

<div class="post-metadata">

**Author:** ![aoi](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/aoi/32/81494_2.png) [@aoi](https://forums.kodeco.com/u/aoi)\
**Post date:** [October 31, 2019, 2:37am UTC](https://forums.kodeco.com/t/your-second-ios-and-swiftui-app-edit-mode-raywenderlich-com/84882/2 "2019-10-31T02:37:24Z")

</div>

Is there a way to navigate from a list row while in editing mode? The functionality I’m looking for is like Apple has in their Clock App on the iPhone where you edit the alarm by tapping on the alarm cell while in edit mode.  
Thanks Mike

---

<div class="post-metadata">

**Author:** ![jessycatterwaul](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jessycatterwaul/32/110937_2.png) [@jessycatterwaul](https://forums.kodeco.com/u/jessycatterwaul)\
**Post date:** [October 31, 2019, 5:21pm UTC](https://forums.kodeco.com/t/your-second-ios-and-swiftui-app-edit-mode-raywenderlich-com/84882/3 "2019-10-31T17:21:50Z")

</div>

As far as I’ve been able to figure out, there’s no way to do this, unless you want to leave off the ability to move rows. Apple’s alarms are sorted by time so don’t need to be manually reordered.

---

<div class="post-metadata">

**Author:** ![aoi](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/aoi/32/81494_2.png) [@aoi](https://forums.kodeco.com/u/aoi)\
**Post date:** [October 31, 2019, 9:24pm UTC](https://forums.kodeco.com/t/your-second-ios-and-swiftui-app-edit-mode-raywenderlich-com/84882/4 "2019-10-31T21:24:53Z")

</div>

How’s it done if you don’t need to move the rows?

---

<div class="post-metadata">

**Author:** ![aoi](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/aoi/32/81494_2.png) [@aoi](https://forums.kodeco.com/u/aoi)\
**Post date:** [November 1, 2019, 4:04pm UTC](https://forums.kodeco.com/t/your-second-ios-and-swiftui-app-edit-mode-raywenderlich-com/84882/5 "2019-11-01T16:04:44Z")

</div>

I was able to use @Environment (/.editMode) var editMode and then use the wrappedValue. If it’s .active then I’m in editMode so I can do two different actions (NavigationLinks) based on that Bool. However, when I’m in edit mode at runtime, tapping the row does nothing. It doesn’t trigger the NavigationLink. Only tapping on the row when it’s not in editMode will trigger a NavigationLink. Not sure if this is the correct approach or not.

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [January 11, 2020, 3:18pm UTC](https://forums.kodeco.com/t/your-second-ios-and-swiftui-app-edit-mode-raywenderlich-com/84882/6 "2020-01-11T15:18:29Z")

</div>

@aoi Do you still have issues with this?

---

<div class="post-metadata">

**Author:** ![aoi](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/aoi/32/81494_2.png) [@aoi](https://forums.kodeco.com/u/aoi)\
**Post date:** [January 11, 2020, 3:47pm UTC](https://forums.kodeco.com/t/your-second-ios-and-swiftui-app-edit-mode-raywenderlich-com/84882/7 "2020-01-11T15:47:45Z")

</div>

Yes, never did figure it out. Do you have ideas?

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [January 11, 2020, 3:49pm UTC](https://forums.kodeco.com/t/your-second-ios-and-swiftui-app-edit-mode-raywenderlich-com/84882/8 "2020-01-11T15:49:12Z")

</div>

@jessycatterwaul Can you please help with this when you get a chance? Thank you - much appreciated! :]

---

<div class="post-metadata">

**Author:** ![pelachile](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/pelachile/32/89143_2.png) [@pelachile](https://forums.kodeco.com/u/pelachile)\
**Post date:** [March 19, 2020, 3:49pm UTC](https://forums.kodeco.com/t/your-second-ios-and-swiftui-app-edit-mode-raywenderlich-com/84882/9 "2020-03-19T15:49:54Z")

</div>

I’m using Xcode 11.3 and I get this error:  
Cannot invoke initializer for type ‘NewTaskView’ with an argument list of type ‘(taskStore: TaskStore)’

I have checked my code against yours and can’t figure out what I have done wrong.

Also once I added a new task, the form ceases to work

---

<div class="post-metadata">

**Author:** ![jessycatterwaul](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jessycatterwaul/32/110937_2.png) [@jessycatterwaul](https://forums.kodeco.com/u/jessycatterwaul)\
**Post date:** [March 19, 2020, 4:10pm UTC](https://forums.kodeco.com/t/your-second-ios-and-swiftui-app-edit-mode-raywenderlich-com/84882/10 "2020-03-19T16:10:30Z")

</div>

Upload your project and I’ll have a look!

---

<div class="post-metadata">

**Author:** ![pelachile](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/pelachile/32/89143_2.png) [@pelachile](https://forums.kodeco.com/u/pelachile)\
**Post date:** [March 19, 2020, 8:18pm UTC](https://forums.kodeco.com/t/your-second-ios-and-swiftui-app-edit-mode-raywenderlich-com/84882/11 "2020-03-19T20:18:31Z")

</div>

I fixed the original problem but I still have the crash situation with an index out of range error. Unfortunately, new users can’t upload attachments.

```
ForEach( taskStore.tasks.indices ) { index in
          RowView(task: self.$taskStore.tasks[index])
        }

```

this line of code is throwing a Thread 1: Fatal error: index out of range

---

<div class="post-metadata">

**Author:** ![pelachile](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/pelachile/32/89143_2.png) [@pelachile](https://forums.kodeco.com/u/pelachile)\
**Post date:** [March 19, 2020, 8:24pm UTC](https://forums.kodeco.com/t/your-second-ios-and-swiftui-app-edit-mode-raywenderlich-com/84882/12 "2020-03-19T20:24:01Z")

</div>

Never mind, I did a clean of the build folder and seems to be working now

---

<div class="post-metadata">

**Author:** ![bdmoakley](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/bdmoakley/32/108772_2.png) [@bdmoakley](https://forums.kodeco.com/u/bdmoakley)\
**Post date:** [March 20, 2020, 12:39am UTC](https://forums.kodeco.com/t/your-second-ios-and-swiftui-app-edit-mode-raywenderlich-com/84882/13 "2020-03-20T00:39:41Z")

</div>

Nice job on working through it!
