Optionals confused the hell out of me until this video. The examples showing distinctions between guard let of all three vars vs. layered guard was especially helpful. Thanks so much!
@shaxzodziyadullayev9115
9 ай бұрын
I liked this video. Deeper down into unwrapping optionals compared to other videos out there. Thanks.
@Md.FahimAhmad
11 күн бұрын
love it man. You are such a gem. Thanks nick.
@chandlerketelsen8702
4 ай бұрын
The videos get longer throughout the playlist! I really appreciate the content, thanks!
@jameskayten6563
Жыл бұрын
Thanks very much for these well expressed lessons! It took me three days to get through the optionals as I could only deal with so much info inside of a couple hours. I'll likely forget half of what I learned, but at least there'll be bits of info that will service as hints going forth. There's a bit of confusion introduced in the last bit on chaining optionals. It's generally better to create copies of code blocks you're going to alter to illustrate concepts than returning to previous blocks and doing so. Each block the user creates (with commentary) is better left unedited avoiding typos and missed aspects like for instance the ?. I don't how others learn, but I need to follow along and type code to reinforce the info being conveyed. I'm also a lousy typist so I often get frustrated and lost.... But anyway - again - thanks very much Nick!
@30guarino
Жыл бұрын
Wow...nice job on the explanation on optionals!
@SwiftfulThinking
Жыл бұрын
I know you’ve already completed the other playlists and know this already 😂 thanks though!
@JuanFmTech
Жыл бұрын
not and easy topic but i trust it will be important in the future, thanks for making such a detail explanation, I did some test printing things before and after unwrap and also the explicit of a nil to see it crash, it helped me understand a bit more.
@Declan-Jo6n
Жыл бұрын
these are best swift courses , no words to express my gratitudes
@SwiftfulThinking
Жыл бұрын
Thank you!! These comments help 🙏
@kwkistler
Жыл бұрын
Thank you, Nick, excellent tutorial I look forward to learning more about writing cleaner Swift code Keep up the great tutorials!
@vk1653
6 ай бұрын
Man this video is amazing, you broke this down very well and simple. I been trying to understand optionals for a while, esp the guard statement, but with more practice, I think I understand the concept. Thank you
@wardog29
10 ай бұрын
Nick, thanks so much for this one! Unwrapping and the use of guard was a gray area for me. You make it so easy to understand! Keep up the great work my friend!
@sele_br129
4 ай бұрын
A lot of information together but omg so useful! Thank you so much! Loved the video!
@olatunji2542
5 ай бұрын
I understand optionals better now. Thanks a bunch
@honey.badger
Жыл бұрын
i've watched this vid twice and still don't get it. gonna read the dev book further and come back to this vid later.
@Watashi10
Жыл бұрын
Very very good optionals tutorial. I loved all the examples! Thank you!
@mosh_wash
Жыл бұрын
Tremendous work💪 and very easy to follow🛵 Thanks a lot!
@SwiftfulThinking
Жыл бұрын
Thanks!
@jayvalance
Жыл бұрын
Great Playlist, The best way to learn Swift! i love your video. Thank you!!
@stelluspereira
2 ай бұрын
thankyou Nick, For Non SwitData, objects above work well, but it seems if the object is from SwitData, no way i can delete optional input, for example : let input_ClientMst:ClientMst? // received from another view & i am checking for not nil ... if(input_ClientMst != nil) { modelContext.delete(input_ClientMst) } error Value of optional type 'ClientMst?' must be unwrapped to a value of type 'ClientMst' hope you can guide me , how to unwarp
@toddlask
Жыл бұрын
awesome channel!
@bhavin_thummar
Жыл бұрын
Thanks, Nick, great explanation... I have seen in many articles, there is one more approach to unwrapped. let optional: String? = "I love Swift" if case let unwrapped? = optional { print(unwrapped) } is it the correct way?(for such a case)
@m.d.2029
3 ай бұрын
Большое спасибо! Очень крутое объяснение!
@AnimeWorld-pf9qy
Жыл бұрын
8:55 need to explain what ".description" do => gets you the value of "non-String variable" into a String value , so you can actually do "coalescing operator" and print a "string" value inside \( ) out of "Bool => non String dataType".
@warrenscorner
Жыл бұрын
Awesome! I have an idea for a calculation type app. The user would need to enter some values (how do convert a string to a double?) but of course when the app first opens there aren’t any values. Do these variables need to be optionals or can they be nil?
@user-to7yg5wm6d
Жыл бұрын
Awesome Man Awesome!!!!!!!🤓
@JuanFmTech
Жыл бұрын
it gets better and better
@1zlach
6 ай бұрын
Is there any way to help us visualize (via the console) functions "checkIfUserIsPremium" 1-6? It's quite confusing keeping the different constants and function names separated and understanding how each function works without seeing some final product.
@CMessineo
7 ай бұрын
I'm able to follow the code. But I don't fundamentally understand why I would ever use an optional? What is the benefit of it over a non-optional? Why do I want to have variables that are null? Wouldn't I just rather have a boolean with a default of false, an integer with a default of 0, or a string with a fault of empty?
@SwiftfulThinking
7 ай бұрын
There are times where we can use default values to avoid optionals, but providing a default value is not the same as not having a value. Imagine fetching the user’s age that fails. You could have a default age of 0 or leave it as optional. If it’s optional, you can unwrap it to check that there is an age. If it’s defaulted to 0, it would appear no different than successful. You’d likely need extra logic to confirm it’s not the defaulted value. But high level optionals are fundamentally build into Swift. As you start to build apps you’ll realize it’s a net positive for you as the developer. It’s not a question of “why would I want this” but “how can I handle this” 😅
@CMessineo
7 ай бұрын
@@SwiftfulThinking Thanks so much for the further explanation. That "age check" is a nice example. Overall, I'm really enjoying your videos. I have a simple appthat I intend to build when I finish the lessons and I'm sure some of these things (like optionals) that don't seem that important now, will make more sense when I start coding the app.
@aleksandertesenkov1421
8 ай бұрын
Excellent explanation.
@laundromatsuccess2145
Жыл бұрын
Thank you Nik. Great info!!!
@SwiftfulThinking
Жыл бұрын
Thanks!
@theflutterguy6301
4 ай бұрын
good stuff
@jankuna9479
7 ай бұрын
Wow... great work. Thank you.
@awakeFromNib
Жыл бұрын
Excellent tutorial!
@SwiftfulThinking
Жыл бұрын
Thanks!
@HaKaNOGUZ
9 ай бұрын
Hi Nick. Did someone else record this part? When you started the coding section and suddenly your voice was changed. This was not your voice.
@saikrishnapatha4386
8 ай бұрын
I want source code of all your examples, How can i download it or pls share path
@SwiftfulThinking
8 ай бұрын
GitHub @SwiftfulThinking
@wanwan-q2s
Ай бұрын
how to show declaration when we click on the variable?
@SabinDahal2061
2 күн бұрын
option+ press your mouse
@gibber1sh-c6w
Жыл бұрын
I always get error "Variable binding in a condition requires an initializer" if I refactor the `if let isNew = userIsNew` to `if let isNew` . ChatGTP says that I need to keep the first version so how come it doesn't work? I ran `xcrun swift -version` on my terminal and it says `swift-driver version: 1.45.2 Apple Swift version 5.6.1`. Is the version too old to work with this new syntax you use?
@filipjakub6303
10 ай бұрын
How did you comment more lines at once ?
@SabinDahal2061
2 күн бұрын
you can use /* line1 line2 line3 */ else use command+/ (selecting multiple lines to comment)
@jeff5881
11 ай бұрын
'nil requires a contextual type
@indomitabletr1834
Жыл бұрын
Hi Nick 🤩
@SwiftfulThinking
Жыл бұрын
Helllllooooooooo
@darrenl8584
Жыл бұрын
"promosm" 😭
@jonathanverbeet9234
10 күн бұрын
I've got a question for when I try to access variables in a function. E.g. in this code: var userIsNew: Bool? = true func checkIfUserIsSetup() { if let isNew = userIsNew { } } The Compiler always tells me to add @MainActor before the "func". So when I press on fix the code I end up with this code: var userIsNew: Bool? = true @MainActor func checkIfUserIsSetup() { if let isNew = userIsNew { } } What is the problem and how do I fix that? Can anyone tell me? Sorry for my English. Im not a mother tongue.
Пікірлер: 56