Skip to content

Instantly share code, notes, and snippets.

@RinniSwift
Last active May 21, 2019 17:19
Show Gist options
  • Save RinniSwift/d3bb9bd8bbc0c9ebd724aa906ccb641c to your computer and use it in GitHub Desktop.
Save RinniSwift/d3bb9bd8bbc0c9ebd724aa906ccb641c to your computer and use it in GitHub Desktop.
// 1. empty set initialization
var numbers = Set<Int>()
var nums: Set<Int> = Set()
// 2. empty set initialization with array literal
var numbersSet: Set<Int> = []
// 3. creating set with predefined elements using array literals
var newNums: Set = [1, 2, 3, 4]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment