i have a table where in each dynamic cell there is a label with a URL and a progress view. How can i use the progress view to show the progress of each download from the URL of each cell??
I would store the request objects in an array and then just setup a progress bar in the tableView:cellForRowAtIndexPath: method based on its respective request. This approach is better as opposed to storing the progress bars themselves as table cells and the views inside of them should be reused.
Related
So lets say there is a tableview and within that tableview each cell title and subtitle is loaded from Parse. How would I to make it so that once a cell is tapped and opened, it loads a view controller that has a navigation bar, picture, and text that is unique to that one cell. Each cell would have different text, pictures, and navigation bars, in which that data is loaded from Parse. Can pictures be stored on Parse and retrieved in-app?
I am working in swift. Feel free to ask me for any additional information. Thank you for your time! I appreciate any help!
If each individual cell will display the information related to one specific parse object, set it up so that your detail view controller has a parse object property and then when the user clicks a cell in the first view controller (the table), pass the parse object associated with that cell in prepareForSegue by setting the second view controller's parse object property to that specific object. By doing that, you can access all of that parse object's information in the second view controller through that property.
If the above is not the case, just make sure your second view controller has whatever properties it'll need so the relevant information needed to query Parse for whatever data you're trying to display can be accessed from your detail view controller.
i have a view(page) with lots of textfields,date pickers, etc. This page is displayed using presentModalViewController. Now i want to save the data entered in the textfields to the tableView. Each textfields in the page corresponds to the column in the tableview.
I want to save the page's data on click of a button to the tableview as row wise.
Any Help !!
You could use a protocol and delegate object. Here is a simple example that will show you how to accomplish that:
http://www.theappcodeblog.com/2011/04/15/passing-data-between-views-tutorial-using-a-protocol-delegate-in-your-iphone-app/
Your View is presented from a ViewController, which is Controlling the View.
On clicking the save button on the View, the ViewController can pull the data from the fields in the View, and save them into a Model object which you can then add into your UITableViewDataSource array (or whatever you have to load data into your table).
You can then tell your UITableView to update row at index path, and it will pull the new data from the datasource and update your table.
Voila....
... a cleverer (is that a word) approach would be to bind your Model properties to your View elements (from your controller), so as they are updated, the model changes. The table could be using KVO to listen for Model changes and update their view components at the same time.
I don't want to display my table view cells until the data has been loaded from an external source. I want to show an activity indicator over the table background while the data is loading. I can get the indicator to show by adding it as a subview to tableView, but I can't figure out how to hide the rows until they are ready to be displayed.
This is all being handled in a UITableViewController. The table is displayed in a popover.
You may have differents solutions.
Maybe the first one and the faster, saying to the uiTableView datasource there is no section. Then when your externals datas are loaded, reload the tableView with the sections and rows.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
Other solution, hide the uiTableView and set your activity indicator on an other view. But you need to avoid UITableViewController to achieve this ^^
Maybe the first solution would be the faster ;-)
I have a UIViewController that should be capable of displaying tableViews with multiple data sources. The UITableView spans about half the size of the screen, and there is and up and down button that allows you to go through different data. Everytime the up and down button is hit, I'd like to ultimately use UIViewAnimationTransitionCurlDown or something similar to display the next UITableView.
The question is: do I need multiple UIViewControllers to do this, with a tableView embedded in each one? Should I just create one instance of UITableView and change its data source when an up or down button is hit? If it's only one instance of UITableView, how do I manage to get a curl transition over the portion of the screen it takes up to make it look like a new tableView is coming in?
Why not have each table view belong to its own UITableViewController, and nest these within the current screen's view controller? This way the screen's view controller is responsible for swapping out its subviews, each of which have a table view controller containing the necessary logic to show their data.
In the end, it comes down to what your functionality and data sets look like. It may end up being easier to implement the table view datasource & delegate code once, injecting an actual data source into this class - or it may be easier to write custom datasource code for each table view.
I have a ordinary UITableViewController inside a UINavigationController. The former includes a searchbar which is connected to a search display controller. I use the standard behaviour, i.e. when the user enters any character the search results table view overlays the normal table view.
Now, both table views act inside a navigation controller. If I select one item from the search results table view, a new uitableviewcontroller (with specific information about the item selected) gets pushed onto the nav stack. When I hit the back button on that controller, I observe a strange behavior: The section headers of the normal table view overdraw the section headers of my search results table view. They are displayed as if my normal table view is being displayed (I can see that from the number of rows between the headers, though the rows remain empty). The search result table rows are still being displayed.
This behavior comes from the fact that I reload the table view on viewWillAppear. I do this to react on changes in the database made by the user at some other point in the application or automatic background data updates. I already tried to poll if the recently displayed table view is being shown via
(self.tableView == self.searchDisplayController.searchResultsTableView)
but that statement is always false after I return to my normal table view controller.
The question: how can I poll the correct state of my table view to avoid the displaying errors?
The UISearchDisplayController class implements an active property. Guess what it's used for :-)
e.g. just check for (self.searchDisplayController.active) or ([self.searchDisplayController isActive]).