in two contexts. 1. Type Aliases (alternative name for a type) 2. Associated Types (placeholder for a type in a protocol) Starting in 2.2, the latter will be signaled with the associatedtype keyword (removed in 3.0).
protocol SomeProtocol { associatedtype Container: SequenceType typealias Element = Container.Generator.Element // X } To get around this, use a protocol extension ⭐ protocol SomeProtocol { associatedtype Container: SequenceType } extension SomeProtocol { typealias Element = Container.Generator.Element }
literals for selectors, #selector(_) has been introduced: let sel = #selector(UIView.insertSubview(_:atIndex:)) // `sel` is a `Selector` "insertSubview:atIndex:"