Reference counting describe how an application tracks references and pointers for objects and whatnot. Most typical use case for reference counting is for garbage collection.

Swift uses Automatic Reference Counting behind the scenes to manage a devices resources optimally. However, there are a few cases which a person needs to define weak references such is IBInput and IBOutput.

var john: Person?
var unit4A: Apartment?

john = Person(name: "John Appleseed")
unit4A = Apartment(unit: "4A")

john!.apartment = unit4A
unit4A!.tenant = john

strong and weak connection