Created
October 20, 2022 15:44
-
-
Save TsRebornz/b549f3614ca4ae866a450de33e5cd1da to your computer and use it in GitHub Desktop.
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
class Size { // Changed to class | |
var width: Int | |
let height: Int | |
init(width: Int, height: Int) { | |
self.width = width | |
self.height = height | |
} | |
} | |
struct Table { | |
let size: Size | |
let material: String | |
} | |
let tableSizeKeyPath = \Table.size.width // ReferenceWritableKeyPath<Table, Int> | |
let tableMaterialKeyPath = \Table.material // KeyPath<Table, String> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment