Skip to content

legacy_random

Ian Applebaum edited this page Jun 13, 2020 · 1 revision

Legacy Random

Prefer using type.random(in:) over legacy functions.

  • Identifier: legacy_random
  • Enabled by default: Disabled
  • Supports autocorrection: No
  • Kind: idiomatic
  • Analyzer rule: No
  • Minimum Swift compiler version: 4.2.0
  • Default configuration: warning

Non Triggering Examples

Int.random(in: 0..<10)
Double.random(in: 8.6...111.34)
Float.random(in: 0 ..< 1)

Triggering Examples

arc4random(10)
arc4random_uniform(83)
drand48(52)
Clone this wiki locally