Better Optionals Usage - Swift Tip (iOS) - 2023

  Рет қаралды 7,395

iOS Academy

iOS Academy

Жыл бұрын

In this video, we'll dive into the world of Swift optionals and learn how to write extensions for better code patterns. You'll see how easy it is to extend the functionality of optionals and how it can help simplify and improve the readability of your code. Whether you're a beginner or an experienced Swift developer, this video is a must-watch. So, sit back and join us as we explore the power of extensions on Swift optionals! Don't forget to like and subscribe for more helpful programming tips and tricks.
💻 Source Code: / iosacademy
🎥 Subscribe for more: kzfaq.info?su...
😎 Like my teaching style? Check out some of my most popular courses! courses.iosacademy.io
👉🏼 Connect (personal LinkedIn) / afrazsiddiqui
🚀 Follow on LinkedIn / ios-academy
** Popular Series
Building Instagram: courses.iosacademy.io/p/build...
Building TikTok: / @iosacademy
SwiftUI for Beginners: ios-academy.teachable.com/p/s...
** Get Skillshare free for 2 Months and learn iOS
www.skillshare.com/r/user/afraz
** Manage all your investments from app earnings on Betterment!
bit.ly/3eBwlI9
** Grow your own KZfaq tech channel with TubeBuddy:
www.tubebuddy.com/iosacademy
#swift #optionals #iOSDeveloper

Пікірлер: 30
@ashleydube3710
@ashleydube3710 Жыл бұрын
Thanx, I'm going to implement it right now into a project I'm working on.
@iOSAcademy
@iOSAcademy Жыл бұрын
Excellent!
@nileshjdarji
@nileshjdarji Жыл бұрын
Wow. Saw the extension to optionals for the first time.
@iOSAcademy
@iOSAcademy Жыл бұрын
Nice
@DejaVu_2219
@DejaVu_2219 Жыл бұрын
Useful video and solution to check if the string is nil or empty. But I think in case of nil check only, the new if let guard syntax should be enough. Learned a lot from your videos. Keep up the good work and happy coding.
@iOSAcademy
@iOSAcademy Жыл бұрын
Yes, definitely
@luciarigoni8289
@luciarigoni8289 Жыл бұрын
Thank you, great video!
@iOSAcademy
@iOSAcademy Жыл бұрын
Glad you liked it!
@OnionKnight541
@OnionKnight541 Жыл бұрын
a great video would be going through about a dozen examples of different scenarios where a different pattern / implementation makes more sense than others.
@tokero5199
@tokero5199 Жыл бұрын
Very useful, I have been doing this for a while. I'm doing it like this: extension String? { var isNilOrEmpty: Bool { self?.isEmpty != false } } But I guess the way you do it is a bit cleaner and easier to read.
@iOSAcademy
@iOSAcademy Жыл бұрын
Nice
@mbh01
@mbh01 Жыл бұрын
Very useful, it is exists in Kotlin already and i wanted to see it in Swift! Thank you 🤛
@iOSAcademy
@iOSAcademy Жыл бұрын
Glad it was helpful!
@devayz9305
@devayz9305 Жыл бұрын
Great info, thank you
@iOSAcademy
@iOSAcademy Жыл бұрын
Glad it was helpful!
@vitaliyhalai6017
@vitaliyhalai6017 Жыл бұрын
useful video. thanks 🙏
@iOSAcademy
@iOSAcademy Жыл бұрын
Welcome 😊
@chickenrei3876
@chickenrei3876 Жыл бұрын
What about the video about speech recognition in swiftui that you said a month ago that will come soon?
@noelgomile3675
@noelgomile3675 Жыл бұрын
Why didn't Swift just go for implementing null aware operators?
@user-zn1oh7sr2n
@user-zn1oh7sr2n Жыл бұрын
It's unuseful, because the next step to use name variable is unwrapping where we also can check is unwrapped value empty. And it also will be the same one line.
@iOSAcademy
@iOSAcademy Жыл бұрын
Thanks for the feedback
@TheRicherthanyouguy
@TheRicherthanyouguy Жыл бұрын
I think this is a very helpful tip. I’m primarily a C# developer and and the string type itself has 2 built in methods for this type of thing string.IsNullOrEmpty and string.IsNullOrWhitespace
@iOSAcademy
@iOSAcademy Жыл бұрын
Thanks
@scoutmastert.7181
@scoutmastert.7181 Жыл бұрын
Hey everyone in the comments, hes teaching you UIKit which going a little more complex and soon to be outdated. I highly suggest making the switch to learning SwiftUI instead. Get yourself ahead of the curve
@iOSAcademy
@iOSAcademy Жыл бұрын
Uikit isnt going anywhere soon
@burgermatz
@burgermatz Жыл бұрын
Ok this type of optional extension is pretty cool
@encodedlife
@encodedlife Жыл бұрын
Personally I much prefer { self?.isEmpty ?? true }. .isEmpty is O(1) while the == isn't.
Opaque Types in Swift Explained (2023) - iOS
7:48
iOS Academy
Рет қаралды 10 М.
First Look at Xcode 16's Code Completion #wwdc24
18:33
Swift and Tips
Рет қаралды 9 М.
No empty
00:35
Mamasoboliha
Рет қаралды 10 МЛН
IQ Level: 10000
00:10
Younes Zarou
Рет қаралды 10 МЛН
WORLD'S SHORTEST WOMAN
00:58
Stokes Twins
Рет қаралды 112 МЛН
Better Swift Closures Explained - Swift Tips (2023) - iOS
6:02
iOS Academy
Рет қаралды 7 М.
31 Xcode Tips & Tricks - 2023
17:45
Sean Allen
Рет қаралды 39 М.
How To Read PDF Files In Python
4:12
Taylor's Software
Рет қаралды 395
Detached Tasks in Swift Explained (2023) - iOS Tips
5:49
iOS Academy
Рет қаралды 8 М.
Pixel 9, 9 Pro & 9 Pro Fold - FINAL Leaks & Rumors!
9:54
ZONEofTECH
Рет қаралды 29 М.
Memory Leaks in iOS: Find, Diagnose, & Fix (2022)
12:44
iOS Academy
Рет қаралды 48 М.
Stop using Spacer() in SwiftUI
6:02
Flo writes Code
Рет қаралды 11 М.
Technical Skills You Need to Get Hired as an iOS Developer
7:38
CodeWithChris
Рет қаралды 15 М.
Go in 100 Seconds
2:30
Fireship
Рет қаралды 1,6 МЛН
LLVM in 100 Seconds
2:36
Fireship
Рет қаралды 845 М.
No empty
00:35
Mamasoboliha
Рет қаралды 10 МЛН