Apple released Xcode 7 beta 4 today with some fixes and many improvements of
the Swift language. One of them is
indirect attribute for enums and its cases.
It gives us possibility to create recursive enums. Let’s take a look on example. It is not possible in Xcode 7 beta 3, and Xcode will tell you that “Recursive value type Tree is not allowed”.
With Xcode 7 beta 4 and new
indirect attribute you can create such recursive enum.
I believe next update will bring ability to use
indirect with structs.
Nice, isn’t it?