Last active
February 19, 2022 07:26
-
-
Save kamimi01/311e99ea7c4f9afe2dc7d4ea7f00d80c to your computer and use it in GitHub Desktop.
This file contains 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
func usecase1and2(isUsecase1: Bool) { | |
a() | |
b() | |
// usecase1の時のみ実行 | |
if isUsecase1 { | |
c() | |
} | |
d() | |
} | |
// 呼び出し側が、usecase1か2かを実行時点で理解する必要がある | |
func onAppear() { | |
// 1を使う時 | |
usecase1and2(isUsecase1: true) | |
// 2を使う時 | |
usecase1and2(isUsecase1: false) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment