I am trying to make it where when a user clicks on a table view cell in my table view it takes them to a new view controller. More specifically, when a user clicks on a persons username it should take them to that users profile. the username being the table view cell and the profile being the new view controller. I thought the way to do this was to use the ".presentViewController(vc, animated: true, completion: nil) however when i do this it says "myCell does not have a member named .presentViewController"
If anyone could help me solve this problem it'd be greatly appreciated
The
presentViewController:animated:completion
is an instance method of theUIViewController
notUIView
or a subclass of. You can try this:However, I suggest that you should use the
presentViewController:animated:completion:
method fromUIViewController
. A callback mechanism can be achieved between theUIViewController
and thecell
.Like so:Get button click inside UI table view cell