tableviewcell

Header in TableView is repeating multiple times

筅森魡賤 提交于 2019-12-11 05:36:17
问题 I have a problem with some headers that are repeating on the screen. It seems to appear when I click in a textView in a TableViewCell, it scrolls automatically to put the cell in the middle of the screen, and I write in it during all that process. The header "repeated" can be in the footer, or anywhere else for info. Here is the screenshot: Here is the code: - (NSString *)tableView:(__unused UITableView *)tableView titleForHeaderInSection:(NSInteger)index //HEADER { return [[self

how to recognize label click on custom UITableViewCell - Swift 3

二次信任 提交于 2019-12-11 05:28:58
问题 I have a custom UITableViewCell on which I have a Label , which needs to be made clickable depending on a certain condition. So I have added a TapGestureRecognizer on it. I have used protocols and delegates for the same. I want to pass a parameter along with performing a segue on click of this UILabel . I am able to perform this segue but cannot detect which cell's label was it. I am new to this and have been stuck for a few hours. Any help would be appreciated. Please also tell me if there

swift determine if a certain row disappear from view

点点圈 提交于 2019-12-11 05:11:29
问题 I've have been sniffing around to find the solution but up until now its fruitless. What I want to do is to determine if a certain cell disappeared from screen. Here's the code i have been trying: func tableView(tableView: UITableView, didEndDisplayingCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) { let indexPathWatchCell = NSIndexPath(forRow: 4, inSection: 0) if ((tableView.indexPathsForVisibleRows?.contains(indexPathWatchCell)) == nil){ NSLog("it disappeared!!") } }

How to detect multiple buttons in tableview cell

喜欢而已 提交于 2019-12-11 01:52:32
问题 How to detect multiple buttons in tableview cell and my doubt is with example i have 3 buttons in cell if i tap on one button that button will change colour and and if i click indexpath.row=1 cell button that button will color also need to change help me 回答1: I did like this: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *MyIdentifier = @"MyIdentifier"; UITableViewCell *cell = [tableView

Check if a UITableViewCell is completely visible

自古美人都是妖i 提交于 2019-12-11 00:57:41
问题 How can I check if a UITableViewCell is completely visible on the screen (not cut off by the tab or nav bar)? I can get the visible cells with this code: NSArray *indexes = [_tableView indexPathsForVisibleRows]; but I want to exclude cells that are not entirely visible in the screen. 回答1: As you have, get the visible cells. The only ones that might be partial are the top and bottom ones. For each, check if its rect ( rectForRowAtIndexPath: ) is fully within the bounds of the table view (based

Cell is duplicated multiple times when posting to Firebase

我的未来我决定 提交于 2019-12-10 15:18:47
问题 I'm making an app in which I can post messages. I store my data in Firebase. When I'm posting a new message, that particular cell is duplicating multiple times (so I see the post like 2, 3, 4 or more times). But it's just one post in Firebase. And when I'm refreshing my screen (by for example sorting the data), it's just one post again. What am I doing wrong? Here's my relevant code: override func viewDidLoad() { super.viewDidLoad() DataService.ds.REF_POSTS.observeEventType(.Value, withBlock:

UITableViewCell minimum height with automatically resizing cells

自古美人都是妖i 提交于 2019-12-10 13:25:02
问题 I am using automatically resizing cells in my project. I want to keep the cells at a minimum height , but I cannot set a minimum height constraint for my cells in my Content View (as it is greyed out in the Add New Constraints view: Is there anyway to add minimum height constraints for my cells ? 回答1: When UITableViewAutomaticDimension is enabled the system calls UITableViewCell 's systemLayoutSizeFittingSize:withHorizontalFittingPriority:verticalFittingPriority: method to calculate the cell

How to maintain cell selection in NSUserDefaults?

亡梦爱人 提交于 2019-12-10 11:13:45
问题 https://github.com/lminhtm/LMDropdownView How can I save the last selected cell in NSUserDefault? When the application is reopened the selection should be maintained. Currently, the default cell is selected whenever the app opens. - (void)viewDidLoad { [super viewDidLoad]; self.mapTypes = @[@"Standard", @"Satellite", @"Hybrid"]; self.currentMapTypeIndex = 0; self.dropPinButton.layer.cornerRadius = 5; self.removeAllPinsButton.layer.cornerRadius = 5; self.moreButton.layer.cornerRadius = 5; self

Swift TableView Crash: “Missing cell for newly visible row”

好久不见. 提交于 2019-12-09 21:41:44
问题 Im experiencing a crash when adding new rows to a tableview. In short, the crash log says "Missing cell for newly visible row 3". Reproduction 1. Add N amount of objects to datasource 2. Manually add the same amount of cells to tableview 3. Reload and animate using beginUpdates - endUpdates Known Problem This crash has already been discussed at question and reported at Apple. Their solution to this problem (not using estimated cell heights) does not work for me as i need 2 different heights

Is there a way to navigate from a tableViewCell to another view controller when a cell is swiped?

一曲冷凌霜 提交于 2019-12-08 14:49:04
问题 So here's how I made my swiping cells: Custom Table View Cell Not Swiping. Anyway I was wondering if there was a way of transitioning from a table view to another view controller when a cell is swiped leftwards. I know it can be done when a cell is tapped and calling performSegueWithIdentifier in didSelectRowAtIndexPath but have never seen an example of when a cell is swiped. I tried adding self.performSegueWithIdentifier("detail", sender: self) to the logic of the swipe if recognizer.state =