If I have a class A which has a variable x which is an array of class B, and class B which always has a variable y parent of class A, how do I set up to avoid strong reference cycles. I get an error if I put
class A {
weak var x = [B]
...}
(even if I make it [B]? ) and it seems the wrong way around to put
class B {
weak var y = A
...}
as class B should always have a 'parent' class A.
I imagine this is a standard set up so wondering the normal pattern. Any help much appreciated.