Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Adobels/CodeCallTracker

Repository files navigation

CodeCallTracker

CodeCallTracker facilitates executing code exclusively on its first call

example:

class ViewController: UIViewController {
 private let code = CodeCallTracker()
 override func viewWillAppear(animated: Bool) {
 super.viewWillAppear(animated: animated)
 if code.isFirstTimeCall() {
 // do something only on first call of viewWillAppear
 } else {
 // do something on other calls of viewWillAppear
 }
 }
 
 override func updateViewConstraints() {
 if code.isFirstTimeCall() {
 // do something only on first call of updateViewConstraints
 } else {
 // do something on other calls of updateViewConstraints
 }
 super.updateViewConstraints()
 }
}

About

CodeCallTracker facilitates executing code exclusively on its first call

Topics

Resources

License

Stars

Watchers

Forks

Languages

AltStyle によって変換されたページ (->オリジナル) /