Whats the Difference Between Unowned and Weak References?

TIL I finally learned when to use unowned as opposed to using weak. Differences Under the hood: unowned is essentially a force-unwrap of a weak capture, with all that it entails. Because of this using it slightly more dangerous. Crash danger: Accessing an unowned reference while itโ€™s nil will cause a crash. Compilation error: Every weak reference, must be an optional property. Otherwise youโ€™ll get a compilation error: weak var delegate: DataEntryDelegate = DataHandler() // ERROR: 'weak' variable should have optional type 'DataEntryDelegate?' Call site: Unlike weak references, itโ€™s not mandatory for unowned references to be an optional. This makes the call site cleaner i.e. you donโ€™t have to do the optional unwrapping dance. Similarities Both donโ€™t keep a strong hold on the instance it refers to. Donโ€™t Use unowned for async/network operations. Because the object may become nil and then accessing it would crash! ...