I am building an app in which, one of the function is to press a button that will send an emotion to my server so that I can use it. The concept is easy: the longer the button is pressed, the bigger the emotion is.
In order to do that, I actually need to catch how long this button is pressed and I don't really have a serious clue about how I could do this.
I'm "new" in Swift
programming that's why I'm asking for help, or just an advice! I already did the basic elements, such as creating the button, the class for my viewcontroller
, the IBAction
. But I read a bit about the NSTimer
variables but without truly getting the point of it.
Make a custom class, which will extend
UIView
and implement it as follows:This should work, let me know