Stuck on challenges

I have read iOS Apprentice and followed along with building all the apps. I just finished chapter 3 of Swift Apprentice and feel like I understand most of it, but then when I get to the challenges at the end I don’t know how to do any of them or how to even begin trying to figure then out. I worry that I can read and understand code written by others but whenever I have to come up with something from scratch with a blank screen I can’t do it.

Does anyone else have this problem or have advice? I don’t know how I can learn this.

Hi @fadewave,
Congratulations on two things, one completing the book and the fact that you can read the code. These are big milestones, believe me.

The problem that you are facing or expressing is not a very isolated one, i.e. it is in fact a very common one, many can understand the concepts but unable to apply it. It is like any skill, drawing, juggling, solving a rubics cube. However, the key to solving this is practice and persistence.

We have all gone through that phase, to overcome your situation, think of a problem you like and see how you can solve it with code and then start with the blank screen and try to solve it. You might need a couple of tries but there will be that Eureka moment that will get you through.



@fadewave Thanks very much for your question!

I have a few tips here:

  1. In my humble opinion, perhaps you should have started reading Swift Apprentice before going through the iOS Apprentice. Before learning to write French poetry, one needs to learn French. In the same way, if you want to learn how to build iOS apps, one should first know Swift (or Objective-C). Thus, my suggestion would be for you to complete the Swift Apprentice, and THEN return back to the iOS Apprentice, and go through it AGAIN. I will guarantee you that the examples there will make more sense.

  2. Building iOS apps is one thing, going through Swift challenges are another. I would suggest that perhaps you should WRITE the code out using pen and paper and NO computer. I’m saying this because this way, you force yourself to ensure you know what you’re coding, as opposed to relying on Xcode to help you out. You can confidently say that if you are able to correctly code on paper, then coding in Xcode will be easy.

  3. In fairness, Swift is NOT an easy language. It definitely is not the first language I would advise someone who is new to programming to learn, so cut yourself some slack. Swift is a FUNCTIONAL language, and I’m still trying to wrap my head around many of Swifts concepts. :slight_smile:

  4. Like anything, you need to practice, practice, and practice some more. Refuse to lose. One thing I will say is that you don’t necessarily need to know EVERY feature in Swift, so make sure you focus on some of the core concepts. Make sure you know structs/classes, functions, for/while loops, arrays/dictionaries, Strings, optionals, and so on. Focus on the core concepts, and eventually the rest will follow. Think about it, you don’t need to know the entire English dictionary to speak the language, yet here you are. The same goes with Swift (or any other programming language for that matter).

  5. If you have specific questions that you are struggling with, then please do post them here and we’ll be happy to answer the questions for you. If you want an explanation as to WHY something is the way it is, then do post those questions as well.

  6. Often times we get frustrated to easily. Remind yourself that this is not something impossible to figure out, and that you are smart enough to handle it (and yes, YOU ARE!). If you believe something is difficult, it will be. The best programmers in the world have the same amount of time in the day as you do, so PLEASE do not be intimidated. Nothing good happens without some blood, sweat, and tears :slight_smile:

I hope this helps!

All the best!

1 Like

Having just completed the first 3 chapters of Swift Apprentice, I think the majority of the challenges are well beyond the scope of knowledge provided in each chapter. I find the mini-exercises to be appropriate and reinforce the chapter learnings, but not so for the challenges. They are definitely not what I would consider ‘beginner’ challenges, which is the audience this book is intended to serve. They seem to be less about code and more about mathematics. I mean, what code ‘beginner’ is going to understand Fibonacci numbers and factorials?

That being said, I think the chapter info is explained and presented well and I don’t have any complaints in that regard. It’s just my opinion and feedback that the challenges need to be dialed back some.

1 Like

This topic was automatically closed after 166 days. New replies are no longer allowed.