cgcontextref

Do you need to release CGContextRef in Swift?

谁都会走 提交于 2019-11-30 08:41:46
I've created a context using CGBitmapContextCreate. Do I need to release it using CGContextRelease? I know the answer is yes in Objective-C, but how about in Swift? Thanks! CFTypes are automatically managed unless explicitly specified as Unmanaged. According to the documentation. https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/WorkingWithCocoaDataTypes.html Core Foundation objects returned from annotated APIs are automatically memory managed in Swift—you do not need to invoke the CFRetain, CFRelease, or CFAutorelease functions yourself. If you return