Here's a Swift code snippet to define a Book
struct with properties/title, author, and pageCount:
main.swift78 chars6 lines
You can then create a new instance of Book
with the specified properties as follows:
main.swift92 chars2 lines
And access the properties of the struct with dot notation:
main.swift218 chars4 lines
gistlibby LogSnag