Created
September 17, 2024 04:52
-
-
Save el-hoshino/bfbab6077c456bdd817a4ef913fc3331 to your computer and use it in GitHub Desktop.
Abstraction using struct
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
struct SomeComponent { | |
private var _doSomething: () -> Void | |
init(_doSomething: @escaping () -> Void) { | |
self._doSomething = _doSomething | |
} | |
func doSomething() { | |
_doSomething() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment