Questions tagged [indexpath]
167 questions
0
votes
0 answers
Get a cell UITableView by restorationIdentifier / without indexpath [swift]
how can I go to a cell without an indexpath to change the content
That makes sense:
let cell = tableView.cellForRow(at: indexPath)
But, uh, every cell has a restorationIdentifier.
Can I change the contents of a cell using restorationIdentifier?

Sergo
- 111
- 2
- 10
0
votes
2 answers
How do you retain the current IndexPath.row in a Table View when going from one View Controller to another such as Instagram or Facebook in Swift?
I am trying to retain the current IndexPath.row of a cell in a Table View when passing from one View Controller to another such as Instagram or Facebook. Every time I move from one View Controller to another, I have to call reloadData() for the…

Andrew Gonzales
- 1
- 4
0
votes
1 answer
Delete Cell from UICollectionView Without Reloading
My app is listening to a socket event which tells it when there's been an update to the data which is currently being displayed by the collectionView on screen. When this occurs I'd like to remove the cell corresponding to the updated row from the…

Alk
- 5,215
- 8
- 47
- 116
0
votes
0 answers
Change color of individual section in UICollectionView
My question for today that I have been trying to figure out for a while but what is really buggy or doesn't work because I'm unclear on how to implement it is how to change the color of the individual sections in a collection view. For example, I…

Jaqueline
- 465
- 2
- 8
- 25
0
votes
1 answer
CollectionView cell instance (Outside of delegate) on UIView is not working swift 5
I have a view called HorizontalMenuCollectionView on which I am loading the collection view. I can use it just by hooking it up with any view (from identity inspector).
All are working perfectly. But now I want to set the background color of the…

Tulon
- 4,011
- 6
- 36
- 56
0
votes
1 answer
Change UISegmentedControl.selectedIndex value depending on which UICollectionViewCell is currently shown
how can I change the UISegmentedControl.selectedIndex value depending on which UICollectionViewCell is currently shown?
My collectionView has the isPagingEnabled set to true, and I can easily select a different item depending on the selected index…

Vipera74
- 227
- 3
- 17
0
votes
1 answer
Indexing Multiple Custom TableViewCell Xibs into TableView
I am creating a TableView that starts with an image at the top, approximately 5 cells of parsed json, another image, approximately 3 more cells of parsed json, and another image.
I have 3 custom nibs that I am using. Each one is unique.
I get an…

Allissa Hertz
- 33
- 10
0
votes
0 answers
presently delete core data item in uicollectionviewcell through tag
I am trying to permanently delete a single element from a core data set. Right now the code below removes the core data item but it does not permanently delete it. Once the class is called again it shows up again like nothing happened. I want it…
user7941863
0
votes
0 answers
Is it okay to set IndexPath for TableView using IndexPath(item: 0, section: 0)
I'm trying to set indexPath for tableview to scroll to particular position.
Instead of IndexPath(row: 0, section: 0), I used collection view IndexPath(item: 0, section: 0.
It's working as expected, just want to confirm will it make any…

AP_
- 1,013
- 12
- 13
0
votes
1 answer
How to reset indexPath.row value to zero when reloading data?
I have a UITableView that has about 30 items. Here's an overview of how my tableview works: In order to enable infinite scrolling and a small memory size, I calculate the scrolling direction, speed, and I remove the top 10 items and add 10 items to…

Robert Pelican
- 81
- 2
- 9
0
votes
2 answers
How to get the UITableViewCell from the known index (integer) of the array and not from IndexPath?
have an array data of 50 elements and I display them on a UITable view. I have a button on each UITableViewCell and when I click on that button I highlight the cell by adding a border to it. The data from the highlighted cells are stored in another…

Sharmin Khan
- 177
- 2
- 13
0
votes
4 answers
How to get CollectionViewCell indexPath on Out-sided UIButton Click
How to get indexPath of collectionViewCell on Button click and Button is in Out sided from collectionviewCell. I am trying with sender and Superview. But it is not working.
@IBAction func btnCancel(_ sender: Any) {
if let cell = (sender as…

Coding
- 85
- 1
- 7
0
votes
2 answers
Problem with set ordering property In UICollectionView
I have a strange problem with collectionView, I have two prototypes, first one should draw in indexPath.row=0 and the second one should be created four times.
The second prototype contains one UIView for holding an icon that created with paintCode…

Matt
- 85
- 1
- 6
0
votes
0 answers
Can I store a string from a TextField within a tableViewCell into an array and then use that array again to contemplate its strings in the Textfield?
I would like to store UITextField.text into an array and then fetch the strings into the cells with the text field where I typed in the text before.
I already tried to store the entered text into the array and that seems to work.
goalsCellEntries…

Kuntante
- 23
- 5
0
votes
2 answers
Sectioning UITableView Cells - Repeating Cells
I'm trying to section my Tableview data based on a Key in my Firebase database.
I'm able to section everything properly based on the key (itemPreset).
I'm having trouble assigning the reusable cells to their sections.
The cells keep repeating…

Kunwar Sethi
- 27
- 9