I'm porting one part of my objective-c framework where I had my custom MyNotificationCenter class for observing purposes.
The class had a property of type NSArray with all observables which are interested in notifications.
In objective-c, an array retains its elements, and that is unneeded because observer may not exist anymore at the point when center tries to notify him, and you don't want to have retain cycle.
Therefore I was using this block of code which kept all the items in the array without retaining them:
_observers = CFBridgingRelease(CFArrayCreateMutable(NULL, 0, NULL));
I know Swift is a different beast, however is there such concept in Swift?