One of our priorities while designing Kodika was to offer our users as much functionality as possible, with as little effort on their part as possible. An element that was designed explicitly with that goal in mind was the Tappable View. What is a Tappable View?
The Tappable View is an element that can trigger a function-action when a user taps on it. Simply add it to the desired screen, go to its events and add the function-action you would like it to trigger.
Why choose Tappable View?
One may ask, why not use a Button since they appear to have the same functionality at first sight? A Tappable view should be the element of your choice when you want to avoid the somewhat more complicated design and implementation options that a Button offers. A Tappable view has the designing options of a simple View element. Furthermore, a Tappable view can have as many subviews, with no need for the user to set its userInteraction to false. It is important to specify that there should never be added in a Tappable view another view that can receive an action by the user, like a Button or a Switch. It will ruin its functionality, and kind of destroy its whole purpose. Remember, a Tappable view is a simple tool, with one simple functionality and should be treated as such.
Let's create a yellow Tappable View and add an action for when it is tapped.
We can add with no hesitation a Label, an Image view and another view to our Tappable view.
Let's go and implement the function-action we want triggered when the Tappable view is tapped. For this example, we will set the superview's color to black.
Let's run the app to see the results. To test it, we will press anywhere in the Tappable view, whether that is the Label, the Image view or the View.
It works! Experiment with your own Tappable View!