Skip to content

Instantly share code, notes, and snippets.

@nanotroy
Created August 27, 2019 15:03
Show Gist options
  • Save nanotroy/e4cab196636b8d9ce228b5192eba6fc7 to your computer and use it in GitHub Desktop.
Save nanotroy/e4cab196636b8d9ce228b5192eba6fc7 to your computer and use it in GitHub Desktop.
// Before Swift 5.1 Memberwise initializers:
// Generated memberwise init: init(title: String, url: URL, readCount: Int)
let article = ArticleStruct(title: "", url: URL(string: "")!, readCount: 0)
// After Swift 5.1 Memberwise initializers, using the default 0 for read count
// Generated memberwise init: init(title: String, url: URL, readCount: Int = 0)
let article = ArticleStruct(title: "", url: URL(string: "")!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment