Skip to content

Instantly share code, notes, and snippets.

@noxt
Created March 18, 2019 19:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noxt/ae9b360ba9ccecdd7a6b4fad118e3ab4 to your computer and use it in GitHub Desktop.
Save noxt/ae9b360ba9ccecdd7a6b4fad118e3ab4 to your computer and use it in GitHub Desktop.
NSObject+Configurable
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