Answers for "swift 5 ensure function only called one ata time"

1

run a function only once swift

// Declare your "once-only" closure like this
private lazy var myFunction: Void = {
    // Do something once
}()

...

// Then to execute it, just call
_ = myFunction
Posted by: Guest on March-16-2020

Code answers related to "swift 5 ensure function only called one ata time"

Code answers related to "Swift"

Browse Popular Code Answers by Language