-
Couldn't load subscription status.
- Fork 0
legacy_multiple
Ian Applebaum edited this page Jun 13, 2020
·
1 revision
Prefer using the isMultiple(of:) function instead of using the remainder operator (%).
- Identifier: legacy_multiple
- Enabled by default: Disabled
- Supports autocorrection: No
- Kind: idiomatic
- Analyzer rule: No
- Minimum Swift compiler version: 5.0.0
- Default configuration: warning
cell.contentView.backgroundColor = indexPath.row.isMultiple(of: 2) ? .gray : .whiteguard count.isMultiple(of: 2) else { throw DecodingError.dataCorrupted(...) }sanityCheck(bytes > 0 && bytes.isMultiple(of: 4), "capacity must be multiple of 4 bytes")guard let i = reversedNumbers.firstIndex(where: { $0.isMultiple(of: 2) }) else { return }let constant = 56
let isMultiple = value.isMultiple(of: constant)let constant = 56
let secret = value % constant == 5let secretValue = (value % 3) + 2cell.contentView.backgroundColor = indexPath.row ↓% 2 == 0 ? .gray : .whitecell.contentView.backgroundColor = indexPath.row ↓% 2 != 0 ? .gray : .whiteguard count ↓% 2 == 0 else { throw DecodingError.dataCorrupted(...) }sanityCheck(bytes > 0 && bytes ↓% 4 == 0, "capacity must be multiple of 4 bytes")guard let i = reversedNumbers.firstIndex(where: { $0 ↓% 2 == 0 }) else { return }let constant = 56
let isMultiple = value ↓% constant == 0