Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift 2.2: How can I append to an existing Set?

Tags:

swift2

I want to exploit the properties of a Set but I don't see any way to append to an existing Set.

Here's what I have:

var mySet = Set<Int>()

I would like to do something like:

mySet.append(8)

...which isn't possible.

How can I add to a Set?

like image 874
Frederick C. Lee Avatar asked May 09 '16 17:05

Frederick C. Lee


1 Answers

I discovered the 'insert' command; which is adequate.

like image 176
Frederick C. Lee Avatar answered Nov 13 '22 06:11

Frederick C. Lee