UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Out of Bounds Error on Project 8: Swifty Words

Forums > 100 Days of Swift

Hello,

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

thanks

2      

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.

2      

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.

2      

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

Tip o' the Downing Street bowler to: Nigel

2      

BUILD THE ULTIMATE PORTFOLIO APP Most Swift tutorials help you solve one specific problem, but in my Ultimate Portfolio App series I show you how to get all the best practices into a single app: architecture, testing, performance, accessibility, localization, project organization, and so much more, all while building a SwiftUI app that works on iOS, macOS and watchOS.

Get it on Hacking with Swift+

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

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

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.