Uploaded March 2023 | Updated September 2026, 7 hours ago
Go to squarespace.com/seanallen to save 10% off your first purchase of a website or domain using code SEANALLEN.
Most iOS developers instinctively reach for an Array when using collections in Swift. I recommend stopping and thinking if a Set would work better. Sets offer better performance as well as a bunch of powerful methods to compare Sets.
This tutorial was created using Xcode 14 and iOS 16.
My iOS Dev Courses:
seanallen.teachable.com/?video=_TvQPMZdwPI
iOS Developer Interview Questions Playlist:
youtube.com/playlist?list=PL8seg1JPkqgF5wazzCKSq3EEfqt3t8mvA
Twitter:
Sean Allen - twitter.com/seanallen_dev
Hired.com:
hired.com/x/1n01g
Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):
Paul Hudson's Hacking With Swift:
gumroad.com/a/762098803
Donny Wals - Combine:
gumroad.com/a/909014131
Mark Moeyken’s SwiftUI Books:
bigmountainstudio.com/swiftui-views-book/fzc51
Objc.io Books (Thinking in SwiftUI & Advanced Swift):
gumroad.com/a/656585843
#swift #softwaredeveloper #iosdeveloper
Timestamps:
0:00 - Is there better?
0:29 - Array vs. Set
1:33 - Time Complexity
2:20 - Code Examples
2:47 - Intersection
3:48 - Subtract
4:44 - Disjoint
5:22 - Union
6:06 - Symmetric Difference
7:03 - Subset & Superset
7:55 - Insert, Remove, Contains
Go to squarespace.com/seanallen to save 10% off your first purchase of a website or domain using code SEANALLEN.
Most iOS developers instinctively reach for an Array when using collections in Swift. I recommend stopping and thinking if a Set would work better. Sets offer better performance as well as a bunch of powerful methods to compare Sets.
This tutorial was created using Xcode 14 and iOS 16.
My iOS Dev Courses:
seanallen.teachable.com/?video=_TvQPMZdwPI
iOS Developer Interview Questions Playlist:
youtube.com/playlist?list=PL8seg1JPkqgF5wazzCKSq3EEfqt3t8mvA
Twitter:
Sean Allen - twitter.com/seanallen_dev
Hired.com:
hired.com/x/1n01g
Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):
Paul Hudson's Hacking With Swift:
gumroad.com/a/762098803
Donny Wals - Combine:
gumroad.com/a/909014131
Mark Moeyken’s SwiftUI Books:
bigmountainstudio.com/swiftui-views-book/fzc51
Objc.io Books (Thinking in SwiftUI & Advanced Swift):
gumroad.com/a/656585843
#swift #softwaredeveloper #iosdeveloper
Timestamps:
0:00 - Is there better?
0:29 - Array vs. Set
1:33 - Time Complexity
2:20 - Code Examples
2:47 - Intersection
3:48 - Subtract
4:44 - Disjoint
5:22 - Union
6:06 - Symmetric Difference
7:03 - Subset & Superset
7:55 - Insert, Remove, Contains










