Questions tagged [indexpath]
167 questions
1
vote
1 answer
iOS TableView with Advertisement elements -- IndexPath.row logic
I am looking to add an ad cell at the 0 index as well as at after every three cells thereafter. I was successful to add the first one, but uncertain how to approach this.
Both ads just take a single image.
My current code is as follows:
var adCount…

magellan5
- 37
- 7
1
vote
1 answer
Creating tableView inside tableView
I've created a tableView with prototype cells. Inside each of these prototype cells is another tableView with different prototype cells. I've linked this all together fine, but I'm having trouble modifying the innermost prototype cells. Here is…

Evan
- 1,892
- 2
- 19
- 40
1
vote
2 answers
Find index of container cell
I am trying to create an online shopping app. Currently, I'm working on a page that displays categories in a tableview. Inside of that tableview there is a collectionview that holds items related to that category. For example: The first cell would…

Cooper Hanson
- 31
- 1
- 7
1
vote
2 answers
UICollectionView Getting indexPath in prepareForSegue
For my collection view I use didSelectItemAt to call performSegue. My problem is that the sender is my vc and not the cell itself. So in prepareForSegue, I get an error, because I can't convert the vc to my cell type.
func collectionView(_…

squarehippo10
- 1,855
- 1
- 15
- 45
1
vote
1 answer
Updating table view cells swift
BACKGROUND
I have a simple bill splitting app that allows the users to assign a meal item to multiple people or users. When the meal is assigned to multiple people, the price is divided accordingly. The meal (which contains an item name and a price…

joker449
- 109
- 1
- 9
1
vote
2 answers
What's the most efficient way to reload all rows in a tableview except the first cell?
I have items in a tableview , and i want to reload or update the tableview data , except the first row or the first indexpath of the tableview.
let visibleIndex = self.tableView.visibleCells.compactMap {
tableView.indexPath(for: $0) }
…

BigFire
- 317
- 1
- 4
- 17
1
vote
3 answers
How to split indexPath array into seperate array of indexPath, each array's indexPath has same indexPath.section
Recently I want to delete cells according to indexPaths, so the input parameter of the function is [IndexPath] type, I need to split the [IndexPath] to several arrays according to the indexPath.section, is there any easy way to do this?
For…

whitekevin
- 311
- 3
- 15
1
vote
0 answers
Getting incorrect index number when scrolling through UICollectionView
I'm building a flashcard app where you select a deck of cards from one collection view and depending on the cell being displayed which has a deck title image, you are presented with a particular deck in another collection view.
I have a…

CodeHurts
- 13
- 5
1
vote
1 answer
xcode , indexPath, SearchBar
i have a Problem with my NavigationController and a searchbar with indexPath. I have a Tableview where i have a list of items. The items are 1. image and 1. image description(label) for each row.
Now i tried to paste a SearchBar for the List. It…

Phil
- 13
- 3
1
vote
2 answers
Can't select cell in Table View - swift
I have added this function so that I can select a cell in table view:
extension Home: UITableViewDataSource, UITableViewDelegate{
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print("Row #: \(indexPath)")
…

MontgommeryJR
- 255
- 3
- 18
1
vote
1 answer
Not able to obtain correct indexPath.row value from objective C file in Swift file
File: ContactsViewController.m
In this file I am using the didSelectRowAtIndexPath method to push a new View Controller to show information about the name that was pressed on the Table View Controller. The View Controller that will be displaying the…

Micle84
- 11
- 1
1
vote
2 answers
I want to made Uitableview with dynamic section with dynamic rows
I want to show section title as January,February,March(as per data comes from api) instead of showing January, March, February.
I am getting this data from backend api.
wholeDic : NSDictionary = {
January = (
{
date =…

Gaurav singh
- 13
- 4
1
vote
1 answer
How to access UiLabel in custom cell with indexPath and implement user data into the label
Hi there, i have been trying to fix this for 4 days and still no luck so any help would be appreciated. I am trying to create a table view where workers can upload their profiles and users can scroll through to see which ones they like (see…

Will Annetts
- 9
- 4
1
vote
1 answer
How to fix indexPath error in viewDIdLoad?
I have problem with indexPath.row. Inside the cellForRowAt this lines work perfect:
let cell = tableView.dequeueReusableCell(withIdentifier: "MenuViewCell", for: indexPath) as! MenuViewCell
let item = converters[indexPath.row]
…

Ivan Kisin
- 385
- 1
- 3
- 12
1
vote
1 answer
Swift iOS -How can I pass a value Obtained Directly from a within TableViewCell's SubClass to the TableView's didSelectRow?
Before anyone suggests to pull the Firebase data from within the PlayerController's viewWillAppear, I already know how to do that and if I did it that way I know how to pass the data to the ScoreController. In this situation I need to pull the data…

Lance Samaria
- 17,576
- 18
- 108
- 256