Question:
I’m new to Swift. I would like to know if possible add a “favorite” Button programmatically inside a view controller that inherits from UITableView? I need to say too that I wanna use this button to favorite a result from google API. This is possible once the result comes from a search’s result and not from a specific list? PS: I’m doing my project in UIKIT. Thank you.Answer:
Of course your view controller will then inherit fromUITableViewController
, not UITableView
.Here are the basics:
favoriteButtonItem
until the backend has returned the current value.If you have better answer, please add a comment about this, thank you!