mhs5819
mhs5819

Reputation: 147

Radio button UI in Swift

I want to create a UI that looks like this and allows the user to convert from one unit to various other units. I'm trying to understand what the code would be to create this one-to-many conversion relationship. Can anyone help? Thanks in advance!

enter image description here

Upvotes: 2

Views: 446

Answers (1)

Moriya
Moriya

Reputation: 7906

You could just use two UITableViews side by side and set the selection to single.

Both tableViews can use the same source and on any of their didSelectRowAtIndexPath you could simple calculate the conversion for the selected rows and update the textFields with the new value

You could simply make a custom UITableViewCell to recreate the appearance of the selection circle and update the image on the tableViewCell's setSelected function

Upvotes: 2

Related Questions