Force Cast

Force casts should be avoided

  • Identifier: force_cast
  • Enabled by default: Yes
  • Supports autocorrection: No
  • Kind: idiomatic
  • Analyzer rule: No
  • Minimum Swift compiler version: 5.0.0
  • Default configuration:
    KeyValue
    severity error

Non Triggering Examples

NSNumber() as? Int

Triggering Examples

NSNumber() as! Int