Skip to content

Instantly share code, notes, and snippets.

@heestand-xyz
Created June 20, 2023 04:22
Show Gist options
  • Save heestand-xyz/25d9d2e969e554a2729a59b2f4ade598 to your computer and use it in GitHub Desktop.
Save heestand-xyz/25d9d2e969e554a2729a59b2f4ade598 to your computer and use it in GitHub Desktop.
Allocation Test
extension XCTestCase {
func isDeallocated<T: AnyObject>(_ object: inout T?) -> Bool {
weak var _object: T?
autoreleasepool {
_object = object
object = nil
}
return _object == nil
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment