Your Second iOS and SwiftUI App · Conclusion | raywenderlich.com


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/5662524-your-second-ios-and-swiftui-app/lessons/22

Hello,
thanks for the tutorials they’re really helpful.

I have an error when I try to build the code. on this line (where the indices used to be.) it says "Cannot convert value of type ‘[Task]’ to expected argument type ‘Range ’

I even downloaded your code and still getting this error.

var body: some View {
NavigationView {
List {
ForEach(taskStore.tasks) { index in
RowView(task: self.$taskStore.tasks[index])
}

It sounds like you don’t have the extensions in your project, as I went over at 2:52 in this episode: https://www.raywenderlich.com/5662524-your-second-ios-and-swiftui-app/lessons/20

Let me know if you think something else is wrong!

Hi,
thanks for the fast replied. the extensions are in my project I am not sure that is the issue, I had to use .indices to bypass the error and build it successfully but if I try to remove a task it throws a fatal error.

Huh! Upload your project and I’ll have a look!

(The fatal error is expected. I mean the version that you couldn’t get to compile.)

its okay no worries, I overwrote it with your version but I still get the same error if I remove the indices part from the ForEach when it was in the contentView file.

side question, which is the next class after building the second iOS app?

Beginning Table Views is up next; you can think of it as the UIKit version of this course.

https://www.raywenderlich.com/ios/learn

I just completed recording more SwiftUI material, for a Layout in iOS course. It’s in editing now and will be ready soon!

Hi,
The app crashes when I try to set a task completed. I am getting an error message Thread 1: Exec_Bad_Access in the appDelegate class. I can add a new task, it works fine but the pb is settting a task completed in the EditTaskView. Thanks

I’m not seeing this problem. Are you using the version of the project from the downloadable materials, or your own?

If it’s your own: Your Second iOS and SwiftUI App · Binding | raywenderlich.com - #15 by jessycatterwaul

If not, please let me know what exact steps are triggering that!

I am using my own version of the project. But I did fix it. I had some lines of codes in the wrong places. Thanks for ur reply:)

1 Like

Hi,
I had your problem, too.
The solution is to use the extension files that are in the “End” folder, not the “Begin” folder.
Hope this helps.

Hi, Jessy
I have a problem!
Why this course is so hard to understand especially the extension part?
Do you think it’s not better to teach some basics about those subjects at first?

@mn007 Thank you for your feedback - much appreciated!