Your Second iOS and SwiftUI App · Challenge: Model Collections | 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/3

For some reason when i try creating a task in the array i have to put the Bool status too even when “completed” in the task struct is explicitly false. I got around the error by creating an init that just takes the name and sets “completed” to false, can you explain why that is? also when i created the task’s before creating the init, it didn’t suggest the parameters at all

What version of Xcode are you using? The functionality you need has only been available in Xcode 11. But if you aren’t using Xcode 11, then you can’t be working with a SwiftUI project, so I’m confused!

https://www.raywenderlich.com/4187396-what-s-new-in-swift-5-1#toc-anchor-007

If you can’t figure it out, feel free to post your project and I’ll have a look.

I was unpleasantly surprised when I saw the array of Tasks being created using map. This is a good example of being clever instead of being clear. Since this course is targeting beginners, I think that this example could lead the student toward the dark side.

In the follow-up course (being recorded now!), we’re going to be introducing map. So we decided to show a real use case first, the same as we did with Your First iOS and SwiftUI App introducing concepts that would be covered in greater detail in Programming in Swift: Fundamentals.

I don’t think this code is clever. I think it is clear. It’s possible that we’ll have to agree to disagree on that, but if you have a definition of what constitutes “the dark side”, I’m interested to hear your opinion!

Let me be clear, I’m enjoying your course a lot. The problem that I attempted to communicate is that I’m not a beginning iOS programmer and that I feel that this course, so far, is going to go over the head of a true beginner. If this were labeled as an intermediate level course, I would have nothing but praise.

I can only attribute the “dark side” misunderstanding as cultural differences. :wink:

Again, I am enjoying the course and I know that these things take a lot of work, so thanks for putting it together.

@jimbudet Thank you for your feedback - much appreciated! :]

Disc golf in every state is an awesome task!!

1 Like

Hi, I have a question about this video or rather the code.

I am using Xcode 11.3. I have embedded the two files Task and TaskStore in the Models folder. However, when following the instructions neither do I get the prompts for completing the code, as shown in the video, nor does my code compile. I get an error message when using the map method on the array stating “Use of unresolved identifier 'Task”. However, my Task struct is just as in the video. The error message annoys me. I am at a loss. Is that common with SwiftUI?

Cheers

Not that one! Upload your project and I’ll have a look.

@jezza Do you still have issues with this?

I am having trouble with the Tasks, Task List is not getting updated in this Chapter Adding to your Model
Tried the downloaded code as well, same issue, no errors but list is not getting updated , using the Xcode 12.0.1