hello world
hello world

Reputation: 1755

Set collection type swift

I am learning swift through Apple's documentation and I am on the Collection Types chapter and in the Sets section. One of the examples is this

var letters = Set<Character>()

but when I go to enter that I get this following error.

error: use of unresolved identifier 'Set'
 var letters = Set<Character>()

there was a revision on sets according to their documentation, but nothing is helping me there.

Upvotes: 1

Views: 212

Answers (1)

Claudio Redi
Claudio Redi

Reputation: 68440

Native Set is available since Swift 1.2. Everthing points that you're using a lower version.

Swift 1.2 and Xcode 6.3 beta

New native Set data structure — An unordered collection of unique elements that bridges with NSSet and provides value semantics like Array and Dictionary.

Upvotes: 2

Related Questions