Hello! (just quickly want to mention that I enjoy the swift.org website a loot, it helped me started iOS career)
Today I was reading " Weak and Unowned References" section of this page and noticed this note
If the captured reference will never become nil, it should always be captured as an unowned reference, rather than a weak reference.
In the presented example however that might result in and unexpected issue while assigning
asHTML closure to some variable that will outlive the origin closure holder example:
var heading: HTMLElement? = HTMLElement(name: "heading") var htmlHeadingRenderer = heading?.asHTML print(htmlHeadingRenderer?()) heading = nil print(htmlHeadingRenderer?()) // crash
I think it might be worth giving a hint about such case scenario, wdyt?