How can I capture events from a switch in a UITableViewCell?

In Xcode 8.3.2 Swift 3.1, I have a UITableView where each row contains a label and a switch. I can manage the switches as a group (process the array), but what I would really like is to have a ValueChanged event fire in the parent UIViewController wh

Tableview cell subtitles

My tableview cell subtitles aren't showing when I use this: func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { var cell:UITableViewCell? if tableView.tag == 1 { guard let latestCell = tableView.dequeueReu

iOS Swift Custom Cell NavigationController

I have CollectionView in TableView. everything ok but. when I want to navigate my cell to another viewController I got error func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath){ let storyboard = UISt

Scroll down the table view when you use the dynamic cell height

How can I scroll my table view to the bottom when using dynamic cell height? For some reason this code does not work in this scenario: [self.tableView scrollRectToVisible:CGRectMake(0, self.tableView.contentSize.height - self.tableView.bounds.size.he

How to add a custom UIView to running UITableViewCell?

I have a TableView having multiple custom cell. I want to add custom View on top of the cell runtime. I have cell like this. Now I want to add the HR Channel top view on the same cell runtime so that the it should look like this. As example : Think a

Count the number of selected rows in uitableview

What I actually want to do is to count the number of rows selected after selecting and deselecting the row. I get the total count but when I deselect the row I want to get count as how many other rows are still selected. My code is as follows //count

Universal application Xcode iPad UITableView size

I've created an universal app in Xcode 6 and the iPhone storyboard has a UIViewController that contains a UITableView, it works fine. I made the iPad storyboard the same as the iPhone and added all the classes and elements but the UITableView is disp

Update UITableView when UIScrollView content changes

I have 2 ViewControllers, each of which includes a scrollview (that shows several graphs) and a tableview. I'd like to update the tableview content based on the current graph displayed in the scrollview. The scrollview is managed by a separate class

Delete custom lines from UITableView

I'm just practicing with UITableView. Here is what I did so far. made cells with xib.file from scratch. Data is stored in P-list. Using [ MutableCopy] and convert array into mutableArray It looks little strange but I made the delegate connection usin

Added CALayer to UITableViewCell removed after scrolling

I am trying to add a CALayer to the bottom part of my UITableViewCell to get a bit of a "shadow" effect. The problem is when the table is scrolled up and off the screen the layer is removed, so when you scroll back down it isn't visible. If you

Changing the UIButton image in multiple UITableViewCells

I am currently building an iOS app that uses a UITableView with custom UITableViewCells that include a button. What I want to accomplish is having the UIButton's image change on touch up inside. That part is working fine, the issue is when you scroll

How to remove extra spaces above UITableView?

I'm have been trying to get the header of the table scrolling along with the UITableView. It's finally working, however, now there's a whitespace showing up right under the map view (see screenshot). I had difficulty getting the map in the table head

UITableView does not display data in the iPad application

I have ipad app in which i am using tableView to show data but problem is that it does not show data in tableView here is code for setting cell value - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPa

How to loop in a table and gray text in UITableView

I have an array that gets created in viewWillAppear and the result in the console looks like this data SecArray........... ( ( "<NSIndexPath 0x7f17630> 2 indexes [0, 0]" ), ( "<NSIndexPath 0x7f96430> 2 indexes [1, 0]", &quo

UITableView Pagination

My app has custom UITableView cells. I want to show only one cell at a time - next cell should show partially. In ScrollView you can set isPagingEnabled to YES. But how can i do above in UITableView? ThanksNote that UITableView inherits from UIScroll

Structure of the file system in the table view

I'm a iOS newbie, be gentle :) I need to populate a table view with a file system like structure with folders and files. The structures depth is dynamic. At the moment I reuse the same table view and reload it's data if a folder is selected to show t

Placeholder cell in a UITableView

Suppose I have a UITableView with two sections. If the data source for that section is empty I would like to display a placeholder cell with the text "Section Name is empty." How can I do that? Code - (NSString *)tableView:(UITableView *)tableVi

UIImage in UITableViewCell

I'm trying to put image in UITableViewCell. I use SSMessages style for my messages. Tried something like cell.imageView.image = [UIImage imageNamed:message.messageText]; but it isn't work. Any suggestions? Maybe need my other code?Use SSMessageTableV

how to maintain the state of the button image in tableview

I have one table view and each cell has one button after pressing button, button image got change but if I scroll tableview then button image comes in previous state how to avoid this problem.Store in an Array the state of the button, and when the ce

When to load the data into UITableViewController?

I am currently loading data coming from a JSON service in the viewDidLoad method in UITableViewController. The problem is that is the data takes time to be retrieved and parsed, the view takes time to be created. Where is the best place to load this

Cell-specific action like the drop-down menu

I'm attempting to implement a slide-in menu like in the facebook app. I have a NIB for a custom UITableViewCell, which includes a button. The button has an IBAction associated with it, in which I animate in a subview of my NIB (the delete/edit menu).