Created
June 20, 2023 04:22
-
-
Save heestand-xyz/25d9d2e969e554a2729a59b2f4ade598 to your computer and use it in GitHub Desktop.
Allocation Test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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