|
Hi guys, I've been trying to wrap my head around one of Paul's hints saying: "So, we can use indexPath.row to set the selectedPictureNumber property in DetailViewController – just make sure you add 1 to it so that it counts from 1 rather than 0." Got totally lost with how I can use indexPath.row in DetailViewController without triggering the "Unresolved Identifier" error. What am I doing wrong? Cheers! |
|
You don't use |
|
Ok, thanks! For total pictures I used pictures.count - was I supposed to do it this way? Anyway, the code works, which makes my brain free for the rest of the day :D Thanks! |
|
|
|
Solved it also. Took some trying and figuring out, but once I had it I understood why. Also, I found that if I pulled up print(imageToLoad.count) in DetailedViewController I got an output of 12. Unsure why, possibly something to do with the Loops? So I called this .count from ViewController before passing it to DetailedViewController I hope this helps anyone, without giving away the full coded answer. |
|
|
|
I'm late to the game, but would like to give my 2 cents too for folks that want more visual It's something like this in
While over in |
GO FURTHER, FASTER Unleash your full potential as a Swift developer with the all-new Swift Career Accelerator: the most comprehensive, career-transforming learning resource ever created for iOS development. Whether you’re just starting out, looking to land your first job, or aiming to become a lead developer, this program offers everything you need to level up – from mastering Swift’s latest features to conquering interview questions and building robust portfolios.
Sponsor Hacking with Swift and reach the world's largest Swift community!
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.
Link copied to your pasteboard.