A
A
Abra Kadabra2017-08-14 23:38:15
iOS
Abra Kadabra, 2017-08-14 23:38:15

What is the best way to add an element programmatically if it should have a click and different states?

Hello.
I need to create an element that will contain pictures, some text elements inside.
At the same time, it is necessary that the element be clickable and change the background when clicked.
There should be 50+ such elements on the screen.
f5688e38683841408c2c77c8b5904401.png
Button or view?
Add gesture recognition to each button = create the same number of gesture recognizers or is one enough?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Korolevskiy, 2017-08-15
@korolevsky_s

Button or view?

Create a view, and place buttons, textfields, etc. in it.
This is where OOP patterns come in handy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question