unsafeDowncast

func unsafeDowncast<T : AnyObject>(_: AnyObject)

returns: x as T.

Requires: x is T. In particular, in -O builds, no test is performed to ensure that x actually has dynamic type T.

Warning: Trades safety for performance. Use unsafeDowncast only when x as T has proven to be a performance problem and you are confident that, always, x is T. It is better than an unsafeBitCast because it's more restrictive, and because checking is still performed in debug builds.

Declaration

func unsafeDowncast<T : AnyObject>(x: AnyObject) -> T