IntrepidPursuits / swift-wisdom

A collection of additions to the Swift Standard Library created by Intrepid Pursuits developers
MIT License
39 stars 14 forks source link

Weak Block #102

Closed alexpersian closed 7 years ago

alexpersian commented 7 years ago

Motive: The Block type alias is very useful, but it means it's not always clear that self will be strongly captured when using.

Proposal: Add a second type alias called WeakBlock that expects a [weak self] capture list to ensure that strong reference cycles don't occur.

Edit: so capture lists can't be specified through type aliases, so I'm going to solve this through documentation.

alexpersian commented 7 years ago

Addressed through #137