Created
August 24, 2023 12:17
-
-
Save josippetric/9d0f312f978923297b4cbf4e59ae0487 to your computer and use it in GitHub Desktop.
Weak Reference Virtual Proxy
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
| private final class WeakRefVirtualProxy<T: AnyObject> { | |
| private weak var object: T? | |
| init(object: T) { | |
| self.object = object | |
| } | |
| } | |
| extension WeakRefVirtualProxy: ConformingProtocol where T: ConformingProtocol { | |
| func methodFromProtocol(aBoolProperty: Bool) { | |
| object?.methodFromProtocol(aBoolProperty: aBoolProperty) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment