WWDC22 SALE: Save 50% on all my Swift books and bundles! >>

Out of Bounds Error on Project 8: Swifty Words

Forums > 100 Days of Swift


So i tried running the code as is from project 8 swifty words with both files attached but i keep getting thrown an out of bounds exception at this line

let clue = parts[1]

![Screen Shot](/Users/christophermaduka/Desktop/Screen\ Shot\ 2022-04-12\ at\ 9.25.27\ AM.png)

** Also a noob here so dont know how to attach images to this text box format

any help would be apprectiated



You have to upload images to Dropbox or Imgur or some other online service (or even your own server) and then use that URL.

Hint for Dropbox: If you replace the dl=0 at the end of the link with raw=1, the forum will display the image rather than the link.


If I remember rightly, that you load a txt file from bundle. The error sound that this has not loaded the file into the parts array. You can check by a print(parts.count) and this needs not to be zero.


See -> How to Add a Graphic to a HWS Post

Tip o' the Downing Street bowler to: Nigel


Hacking with Swift is sponsored by Emerge

SPONSORED Why are Swift reference types bad for app startup time, and what’s the performance cost of protocol conformances? That’s just a couple of the topics you can learn about on the Emerge blog — written by the app performance experts behind Emerge’s advanced app optimization and monitoring tools, based on their experience of working at companies like Apple, Airbnb, Snap, and Spotify.

Find out more

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.