0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Swiftリファクタリング事例①

0
Posted at

以下のコードを条件を変えずにもっと簡潔に書きたいです。ネストを減らしたいです。どのように書きますか?

【リファクタリング前】

if isStart {
  if !isClear {
    // ゲーム中
  }
} else {
  // スタートボタンを表示
}

【リファクタリング後】

if isStart && !isClear {
  // ゲーム中
}
if !isStart {
  // スタートボタンを表示
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?