Skip to content

Protocol No I Prefix (ARCH9003)

Key swift.naming.protocol-no-i-prefix · Severity info · Category naming

Flags protocols prefixed with ‘I’ (IUserRepository) - a .NET habit; Swift protocols read as nouns or -able/-ible adjectives.

protocol IUserRepository { func find(id: Int) -> User? }
protocol UserRepository { func find(id: Int) -> User? }

Drop the prefix; name the conforming type (DefaultUserRepository) instead.