Using blocks which captures self (explicitly or automatically by referencing an iVar!) you have the chance to a retain cycle where the block keeps self and self keeps the block or a crash when self is released. This is true for Obj-C as well as for Swift. The proper usage declared by Apple itself: store […]
Category: Swift
Allocate Swift objects from Objective-C
Using mixed projects you can face with several challenging situations. One of them is the allocation of Swift objects in ObjC code. The general problem that Swift objects doesn’t have an alloc method which is used to allocate the memory in ObjC ([[SwiftClass alloc] init]). To access the Swift object you should prefix it with @objc – or subclass […]