This is what you can do with Enums in Swift
Автор: Swift and Tips
Загружено: 2021-11-01
Просмотров: 5930
Описание:
Hello everyone, today we will talk about my favorite feature in Swift: Enums
Enums are art because they help you to represent a finite number of possibilities in our software problems. Swift makes use of enums in A LOT OF WAYS. Let's begin and discover more about all its magic!
Content:
0:00 - Intro
0:27 - Blackjack Rules
0:54 - The problem that enums solve
2:01 - The basics
3:01 - Raw Values
4:30 - Enums support computer properties
5:09 - Avoid default in a Switch
6:09 - Blackjack Game
6:30 - CaseIterable
7:03 - Generate blackjack hands
7:23 - Associated Values
8:02 - Business logic for BlackJack
11:51 - Get associated values in a switch
12:31 - Protocols in Enums
13:16 - Recursive enums (Indirect)
15:00 - Getting a single case from an if
15:38 - BlackJack in SwiftUI
17:03 - Enum actions that represent UI events
18:58 - Do you want to learn more?
------
Source code shown in the video:
https://github.com/pitt500/swift-and-...
------
Resources:
Swift.org: https://docs.swift.org/swift-book/Lan...
Binary tree with enums: / swift-3-enums-and-binary-search-trees
------
Other videos in the channel:
Why can't you use Int indices in a String?: • Why can't you use an Int index in Swift St...
LazyVStack: • Performance between LazyVStack, VStack and...
GeometryReader and apple Watch animations: • Building Apple Watch Layout with Geometry ...
What's new in SwiftUI 3.0: • What's new in SwiftUI 3.0? #WWDC21
Swift Concurrency: • Swift Concurrency
-----
Don't forget to subscribe to the channel, like it, and follow me on social media:
Twitter:
/ swiftandtips
/ pitt500
Finally, ask me for a video you would like to see next 😄!
Credits:
Music by Wataboi from https://pixabay.com/
Video edited with LumaFusion
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: