AceMobileInterview

iOS track

General topic questions

Generics Basics

MediumCommon

Free section · general topics & algorithms

How do generics and associated types differ in Swift?

Reveal model answer
Generics parameterize types/functions (Array<Element>). Associated types parameterize protocols (IteratorProtocol.Element). Use type erasure (any/some) when you need existential flexibility.
GCD vs Swift ConcurrencyError Handling Patterns