|
Hi all! I feel very stupid because I can’t figure out how to create a challenge in first project change size, number pictures and more Please help me :( I really try, but for some reason I can’t understand such simple things Thank you!! |
|
i wrote this in ViewController but Xcode gives out mistake |
|
|
|
|
|
'tableView(_:didSelectRowAt:)' has already been overridden Value of type 'DetailViewController' has no member 'selectedImagePosition' Value of type 'DetailViewController' has no member 'totalNumberOfImages' xcode gives me these errors maybe I placed this code in the wrong place? |
|
Well seems like you have two of those functions in your code. Leave the one that you posted above and just delete the one with the same name. All your logic for selection for the table should be handled by that function.
as for the latter two errors: You have to add those variables to your Detail View Controller and then use them to display information.
|
|
this code works!!! Please tell me how you found out that you need to delete the upper code and add these two lines to Detail View Controller? because I also want to understand how it all works because the projects will be more complicated in the future thank you so much!! i live in Ukraine and it is really the only forum where I can learn Swift thank you ;) |
|
Every skill takes time to learn. You will learn more with practice. So be patient and keep coding. In simple words this part of code As for the second question. You are passing the values to another class. But another class has to accept those values in the first place. So you create vars in the second class and then when you initiate that class you are just passing it. Think like so: in order to work and exist class B requires var C and var D. So you are creating that class like we created DetailedView and passed tha values C and D, and you can do whatever you want with them. BUT if you make your class B without any vars C and D and then trying to pass them to it. It says what the heck you are giving to me, i don't need that rubbish, leave me alone :) You may also want to buy this book. I am not associated with the author in any way, just my recommendation. I still at times refer to that book, when i need to refresh my knowledge or learn something new. I know hard copy might be a bit expensive, but you can by ebook which is only 10$, almost free taking into account information in contains...
|
|
SPONSORED Get accurate app localizations in minutes using AI. Choose your languages & receive translations for 40+ markets!
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.