Created
March 18, 2019 19:35
-
-
Save noxt/ae9b360ba9ccecdd7a6b4fad118e3ab4 to your computer and use it in GitHub Desktop.
NSObject+Configurable
This file contains 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
import Foundation | |
protocol InitConfigurable { | |
init() | |
} | |
extension InitConfigurable { | |
init(configure: (Self) -> Void) { | |
self.init() | |
configure(self) | |
} | |
} | |
extension NSObject: InitConfigurable { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment