Created
June 9, 2019 02:23
-
-
Save noa4021J/6bb2c76ca7485d7ac14df1711e9192b1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private lazy var onlyOnceRun: (()->Void)? = { | |
//ViewDidLayoutSubviewsの中で1度だけ実行されるコード | |
print("2回目以降は出力されないよ") | |
//1度実行された直後にnilを返すため2回目以降は実行されない | |
return nil | |
}() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment