- [Narrator] Because sets only store unique values,…there are a number of useful operations…you can perform with them.…So let's copy our active quest variable with command C…and we'll go to the next section and paste it.…Now let's create a second set called completed quests…and we'll set this to type set.…

For the values, we can add a few that are…in our active quests already.…So I'm going to use Big Boss, All-4-One,…and Hereafter.…Now that we have two sets,…we can look at the four fundamental operations.…Now these are intersection, difference, union,…and subtraction.…Now all of these do pretty much exactly…what they sound like.…So if we call intersection on our active quests,…we're going to feed it another sequence…so we're going to choose the first option here.…

And for the other sequence,…we're going to use completed quests.…In the right hand panel…you'll see that this will create a new set…with all the values that are common to both of these,…which is only one, Big Boss.…Now let's call symmetric difference…on our active quests…

Resume Transcript Auto-Scroll

Author

Released

11/9/2017

Since its debut in 2014, Swift has broken ground as a programming language that's particularly expressive, fast, and safe. In this course, instructor Harrison Ferrone helps you gain hands-on experience with Swift 4, and prepares you to start developing your own iOS apps and games by using this fun, popular language. Beginning with an overview of its releases and features, Harrison takes you through each component of the language. He covers variables and constants, core array methods, functions, classes and structs, and more—explaining what you need to know to become proficient in programming with Swift.