Navio53
Navio53

Reputation: 591

How to Put PFQueryTableViewController Inside UIViewController iOS Swift

I want to put a PFQueryTableViewController inside my class which is a UITableViewController but I'm having a hard time figuring out how. I need this setup because my UIViewController is going to have a textview and button which need to be outside the table view not inside of it. I also need the data in the table view to load as soon as my UITableViewController gets segued into. Any one know how to do this?

Upvotes: 0

Views: 395

Answers (1)

So what you could do is the following:

  1. Insert a view within a view with something like this

  2. The second view, define it as PFQueryTableViewController

  3. Make a segue between the two.
  4. Have a prepareForSegue() function pass the values of the button and textview of the parent view to the smaller child view or vice versa.

perhaps this could end up being useful.

Note: There's probably a more efficient and elegant solution out there, but based on what you described you want to do, this seems like a "hack" way to achieve it. I'd suggest try to implement it and then find other ways that could be more efficient.

As for how to make sure your data is loaded into the table when segued into, this tutorial could prove useful.

Upvotes: 1

Related Questions