Skip to content

Glossary: Swift Beyond the Basics

some vs any

Also written: any, any Protocol, boxed

`some Store` is one fixed hidden type, while `any Store` is a box that may hold any conforming type, even a mix in one array. Prefer `some` and generics unless you truly need a mix.

Where the book teaches it

Related terms

opaque typeassociated type