-
-
Save wilmarvh/3f7a5baeb0c5acea0e2433f1ef1d8815 to your computer and use it in GitHub Desktop.
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 func with<T: NSView>(_ value: T, _ builder: (T) -> Void) { | |
builder(value) | |
} | |
private func with<T: NSView>(_ value: T, _ builder: (T) throws -> Void) rethrows { | |
try builder(value) | |
} | |
// Use | |
with(self.collectionView) { | |
$0.dataSource = self | |
$0.delegate = self | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment