UITableview selection row button should deselected same position in another row - ios

I have list of 5 button in each row for UITableViewCell
Total number of row count is 2.
If I select the first button in first row or second row then the other button of the same position should be deselect in another row vise versa
Please find the attachment:

1 way:set relationships between your buttons and their owner cell. Reload layoutsubviews of cell to set its buttons' image.
2 way:set Tag for each button and reset corresponding button image in one button's action target.

Related

SwiftUI Autoscroll all horizontal row on UITableView

How to programmatically scroll ScrollViewReader component inside UITableViewCell
Basically, I have 2 horizontal axis (rows) inside UITableViewCell.
As shown in an attached gif file, I select the h3 option on the first axis, explicitly scroll, and move it out of bounds.
On the 2nd when I selected option v4, the first row selected option also should be visible on the screen.
When the user selects open on the axis(row) it shows selected in center position by below lines of code.
.onChange(of: viewModel.selectedId) { _ in
proxy.scrollTo(viewModel.selectedId, anchor: .center)
}
I want to apply the same things to previously selected row. so I this case, auto-scroll to the selected option in the first row when the user performs q selection action in a second row.
Does anyone know how can I do it?

How to trigger button selection over cell selection in swift

Situation:
So I have a set of DLradiobuttons inside a custom tableViewCell. The table expands when I click the label(ex. UseVisuals or visual schedule) and shows the options below. After I expand a row, the buttons should be allowed to be clicked, but rather the cell itself is clicked and highlighted.
Issue:
Is there a way to prioritize radiobutton selection over the cell selection?
I created the cells programmatically but the buttons are created in the storyboard. Could it be causing the issue? Should I implement the buttons programmatically as well?
Screen Image is as below
To stop cell selection do
1. By code
cell.selectionStyle = UITableViewCellSelectionStyle.none
2. By storyboard
Select your tableView and change the property Selection as below

How to set button to scroll to next tableview row?

So each row has the same button and I want that button to scroll to the next row.
In tableView, you can set each button has different tags(button.tag). When you selected it, use tag to decide which row you will scroll to.

how to add data separately in cell of tableview separately

I'm having three buttons on table view cell and have to show some text on label below it but when i'm clicking on button and selecting text it shows in all row and if second button clicks data of first label get blank so is their any way to fill data seprately to cell of table view
Yes it is you have to test for indexPath to see if that cell will display or not what you want. And keep in mind that cell are reused so you have also to remove content from cells or use different cell identifiers for each type of cell.

How can I add stars icons to my UITableView on the left of each row?

How can I add stars icons to my UITableView like the ones in the picture ?
http://cl.ly/9bSr
They can be selected (the star icon changes and possibly the row should slide up in the first section).
How to implement it ?
1.create custom cell
2.take one button and set its frame as your need
3.set star image as buttons background image and add button to custom cell
4.replace that cell with your existing table cell

Resources