It’s my first time posting here but from the looks of it the community seems really supportive and organized - love it!
After years of giving up bc of constraints and other little things, I finally decided to try it Xcode again bc I’ve recently taken a course on IOS dev. So a quarter in I decided to test my knowledge and try a personal project. The journey has been roadblock after roadblock but I’ve surprised myself by persisting on and solving problems. Anyways enough jibber jab lol.
I’m struggling with passing data back. I know how to pass data forwards but vice versa has been a challenge.
My layout consist of:
-
Selection Bar Controller
-
FeaturedViewController
-
TableViewController
-
TableViewController
-
-
SearchViewController
-
BookmarksTableViewController
-
So currently I have cells that I can bookmark in the tableviewcontrollers, but that’s just about it. I want to place those bookmarks automatically inside the BookmarksTableViewController. So inside of my tableViewControllers I have back buttons that go back to the FeaturedViewController and I thought I’d pass the data back using this inside of the tableviewControllers once I go back to the Featured controller and then I’d pass that data back to the BookmarksTableViewController.
let destinationFeatured = FeaturedViewController()
destinationFeatured.bookmarks = bookmarks
but this idea didn’t work as I think its too simple probably for what I’m trying to do.
I’m struggling on this but I feel like its simple. I read somewhere that using a protocol and delegate would be good, but I’m so confused on that. I have a struct for the cells’ information so that’s good. But yeah I’m just so lost and I really want to learn. I don’t want to take code from the internet and just add it because it appears that’s what I need. I want to understand why I’m applying that idea to my code. Please help! Thank you guys!