0

I am using Swift with Parse.com. I have a bridging header so I presume that I can use objective-C within the swift project, but I get errors sometimes, so I want to make sure that I am using the two languages correctly within the same project.

I remain unclear how I can use tableView to load information from Parse instead of using the tableViewController for added customization. I would like to be able to use the needed methods within the view controller that contains the tableView object, and reload that information to populate that element.

I need to an update on the requirements of proper classes and if I need to subclass, and how. I have generated my own class for the view controller and connected the tableView object, but I remain unclear how I can call the methods from a normal tableviewcontroller, or if I can simply place the needed methods within the view controller. I am learning about the PFClasses and which ones are needed for the functions that are required.

I currently remain unclear about the communication of the delegates, datasource, and other related items in this arrangement. I am completing project. I am still new to objective-C and have not memorized all of the methods and such, so I am still learning.

1 Answer 1

1

It is possible to use a plain UIViewController and have a manual UITableView instead of using a UITableViewController. If you do this, you need to make sure that your UIViewController implements the UITableViewDataSource and UITableViewDelegate protocols.

If you are using IB, you also need to make sure you hook up your custom UITableView class to the proper outlets; or you can create your views in code. That's up to you.

Now for parse specific data, what you can do is you can process your parse.com data in a variety of ways; in response to a UI gesture, when the table loads, or in the background. Either way, once you have the parse data loaded, you just need to make sure your UITableView responds correctly in numberOfRows and cellForRowAtIndexPath.

If you get started and have specific questions, feel free to ask more. But in short, yes, it is possible. I actually prefer this over using UITableViewController because it gives me more flexibility. I in general to not use IB.

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you for the direction. I will process with a sample in a few moments. I am working on queries at the moment, and let you know how it works. I didn't see any problems with it in general, and the internet did not have much information to use otherwise using the UITableViewController.
I will update the delegate and the datasource of the tableview to the view controller. Do I need to add any additional information to the view controller class, such as specify delegate protocols? Can I simply copy and paste the needed methods into the view controller and update them as needed?
If your view controller implements the delegate and datasource, you will need to paste the needed methods into the view controller. What I normally do is go to the Apple reference for the UITableViewDelegate and UITableViewDatasource and copy the Swift/Objective-C function definitions that I need, and then I implement them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.