I’m wondering if there is a way to put a one shot in swift programming? If your familiar with PLC ladder logic you will know what I mean by a one shot.
Thank you in advance!
I’m wondering if there is a way to put a one shot in swift programming? If your familiar with PLC ladder logic you will know what I mean by a one shot.
Thank you in advance!
I am not familiar with a specific function within Xcode that will achieve this however you can perform a sequential logic that depends on a variables state. Where bool1 is responsible for starting the sequence, bool2 is the latch/reset and var1 is the variable you wish to modify (or represents a section of code you only want performed once.)
var bool1 = false
var bool2 = false
var var1 = ""
if (bool1 == true && bool2 == true)
{
var1 = "run code"
bool2 = false
}
hope this helps?