No video

Swift Error Handling - Do, Try, Catch - iOS Interview Question Series

  Рет қаралды 51,281

Sean Allen

Sean Allen

7 жыл бұрын

The next topic in my series on iOS Interview questions explains error handling and the do, try, catch syntax in iOS and Swift. This iOS interview question was asked in a few interviews, so it's a good topic to learn. In this tutorial I walk though some basic error handling on a log in screen using the Do, Try, Catch syntax in Swift.
iOS Dev Courses - seanallen.teachable.com/
This is part of a series of videos about iOS interview questions in Swift. Check out the overview where I list and briefly discuss all the topics that are in this series:
• iOS Interview Question...
Source Code:
www.dropbox.com/sh/dhhy3kn1ql...
iOS Dev Courses:
seanallen.teachable.com/
Twitter:
Sean Allen - / 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:
www.bigmountainstudio.com/swiftui-views-book/fzc51
Objc.io Books (Thinking in SwiftUI & Advanced Swift):
gumroad.com/a/656585843
Ray Wenderlich Books:
store.raywenderlich.com/a/208...
#swift #softwaredeveloper #iosdeveloper

Пікірлер: 156
@seanallen
@seanallen 4 жыл бұрын
Watch Next - iOS Take Home Project - Job Interview Practice - Free Preview - kzfaq.info/get/bejne/g7l5mJWqm6zJlWw.html
@nadersaid2370
@nadersaid2370 4 жыл бұрын
quick stupid question, i know this video is about Error Handling - Do, Try, Catch but what if i in this particular situation do it with a simple if else in loginButtonTapped to just show the appropriate alert? will it be a bad code?
@renagurbanovasenglish
@renagurbanovasenglish 3 ай бұрын
Thank you, even after 6 years, your code and teaching is still actual
@bigmtnstudio
@bigmtnstudio 6 жыл бұрын
Awesome video! I like how you reinforced the "throw" keyword in there. 😃 The repetition makes it stick! Thanks, Sean.
@seanallen
@seanallen 6 жыл бұрын
Thanks Mark! I'm a strong believer in the power of repetition when learning... especially in programming!
@slash0t5
@slash0t5 4 жыл бұрын
If I have to learn any difficult concept, I look up your videos. You explain it better than anybody else.
@seanallen
@seanallen 4 жыл бұрын
Thanks for the kind words. Happy to hear they are helpful!
@tactteam00
@tactteam00 6 жыл бұрын
I love this series for it's organization and simplicity. There are far too many hour long tutorials on these fundamental concepts. You explain it well and show people it's not as hard as many people make it out to be. Subscribed. Cheers
@seanallen
@seanallen 6 жыл бұрын
Thanks for the kind words, Tactteem00. Glad to hear the videos are helping. More on the way!
@javierv.5210
@javierv.5210 6 жыл бұрын
Dude every question I have about iOs, you have a video on it... thx A LOT!!! Happy new years!
@seanallen
@seanallen 6 жыл бұрын
Happy to help, Javier!
@soyhenryxyz
@soyhenryxyz 6 жыл бұрын
Thanks for putting this example into context. Please continue to do your videos so that it's easier to understand where to use these programming concepts.
@seanallen
@seanallen 6 жыл бұрын
Glad you enjoyed it, Henry! More videos on the way after the Thanksgiving Holiday
@tonyferber3252
@tonyferber3252 6 жыл бұрын
Thank you for the rapid explanation, Do, Try and Catch were confusing me. I am surprised to see no less than three Bang Operators !
@fikretsengul6214
@fikretsengul6214 6 жыл бұрын
Hey Mr. Allen, firstly, thank you for everything. I don't know how I discovered you has a wonderful, simple and understandable explanation. I'm a CS student in Ankara Bilkent University. I really wanted to learn swift but it was very complex until I find you. I cannot explain how happy I am, please continue to create these great videos ,series and keep it complete and simple. Thank you again. (sorry for the grammar mistakes)
@seanallen
@seanallen 6 жыл бұрын
Thanks for the kind words, Fikret... More videos coming soon!
@brandonfong9998
@brandonfong9998 4 жыл бұрын
thanks for making these videos!! could you do one on regular expressions in swift and how to use them to validate data users put in text fields?
@martinsin9775
@martinsin9775 6 жыл бұрын
Crystal clear of do try catch! Thank you!
@seanallen
@seanallen 6 жыл бұрын
Glad it helped, Martin 👍
@myrondulay8628
@myrondulay8628 3 жыл бұрын
Very useful. Thanks Sean!
@chrisstromberg6527
@chrisstromberg6527 6 жыл бұрын
This was by far one of the best and most practical explanations of Do/Try/Catch I have seen!
@seanallen
@seanallen 6 жыл бұрын
Thank Chris! Glad you enjoyed it.
@isaacclark9825
@isaacclark9825 7 жыл бұрын
Thanks for continuing your interview series.
@seanallen
@seanallen 7 жыл бұрын
You're welcome, Isaac.
@johntamch
@johntamch 7 жыл бұрын
Another great video from this series! Detailed and yet easy to understand. Thanks.
@seanallen
@seanallen 7 жыл бұрын
Glad you enjoyed it, John!
@ahmedMahmoud-zs5kn
@ahmedMahmoud-zs5kn 5 жыл бұрын
Best tutorial ever for swift error handling , really thank you.
@seanallen
@seanallen 5 жыл бұрын
Glad you liked it!
@egesucu
@egesucu 6 жыл бұрын
Well I'm a beginner developer and I really needed to see some videos about iOS development and etc. I found your channel and enjoying so far. Thanks man :)
@seanallen
@seanallen 6 жыл бұрын
Glad you're enjoying it Ege! Feel free to reach out with any questions if you get stuck on something.
@Sasan_Soroush
@Sasan_Soroush 6 жыл бұрын
Your videos are just what i needed all the time thank you
@seanallen
@seanallen 6 жыл бұрын
Happy to help, Sasan 👍
@yourmovies3724
@yourmovies3724 4 жыл бұрын
Good job! I finally got it
@NLBAMF
@NLBAMF 7 жыл бұрын
my favorite series ... thanks a lot ...
@seanallen
@seanallen 7 жыл бұрын
Thanks for the kind words, Ahmed! I'll keep them coming!
@lowhybrid
@lowhybrid 2 жыл бұрын
Great video. Thanks
@Reel_Sober
@Reel_Sober 7 жыл бұрын
Love your videos man! You are putting out some great content. Thanks for your time and effort.
@seanallen
@seanallen 7 жыл бұрын
Thanks for the kind words, Art! It means a lot.
@jyotinkarpandey
@jyotinkarpandey 6 жыл бұрын
awesome stuff. thanks a lot for this content :)
@SivarajahPranavan
@SivarajahPranavan 6 жыл бұрын
Excellent example for "throw"
@abhilashmathur8390
@abhilashmathur8390 6 жыл бұрын
Nice Video!! Can you explain what is the difference between throws and rethrows?
@choofie
@choofie 7 жыл бұрын
Nice explanation Sean! I’m really enjoying your videos! I know it’s crystal clear to everybody, but please note that the magically code that actually logs you in will be performed asynchronously in the background (obviously). So make sure to handle the successful login request properly, and put your transition code there, instead of simply putting them the next line right after try login(). Otherwise the control will be given back to your do block, where the remaining code will be executed before the login response arrives.
@seanallen
@seanallen 7 жыл бұрын
Thanks for the kind words, Mate! You are correct. I didn't go into all this because I didn't want to distract from the point of the video too much, but it is a good clarification.
@yogeshnewpanay8613
@yogeshnewpanay8613 2 жыл бұрын
bro dont have words you are just great at explaining some people are flaunting their talent by making complex code i agree they know some good stuff but you make swift look easy #highlymotivated
@karunakarbandikatla9462
@karunakarbandikatla9462 7 жыл бұрын
Short and simple... Superb :)
@seanallen
@seanallen 7 жыл бұрын
+Karunakar Bandikatla Glad you enjoyed it.
@taylormaxwell1277
@taylormaxwell1277 4 жыл бұрын
Another excellent share, thank for your the clear explanation
@seanallen
@seanallen 4 жыл бұрын
Thanks for watching all these Taylor. Glad they were helpful.
@saad2execute
@saad2execute 6 жыл бұрын
Great tutorial, thanks a lot :)
@seanallen
@seanallen 6 жыл бұрын
Glad you liked it, Saad!
@SuperMarucca
@SuperMarucca 7 жыл бұрын
Very helpful!!!!! Thank you very much! :)
@seanallen
@seanallen 7 жыл бұрын
Happy to help, Fabio. You're very welcome.
@sudebsarkar21
@sudebsarkar21 6 жыл бұрын
Thanks Sean, This video is very helpful , Can you please make sure that if their is any way to write all error cases in another swift file ? If it is possible, please give an example as I am new in swift so I am facing some problem to write this code.
@brandonb6175
@brandonb6175 7 жыл бұрын
Great Video Sean!
@seanallen
@seanallen 7 жыл бұрын
Thanks Brandon!
@donathmm3881
@donathmm3881 4 жыл бұрын
Thank you!
@seanallen
@seanallen 4 жыл бұрын
Happy to help, Donat!
@seanallen
@seanallen 7 жыл бұрын
Have a question about the Do, Try, Catch syntax? Leave a question below!
@subinrevi1
@subinrevi1 6 жыл бұрын
Hey Sean, you mentioned that we use do,try,catch in cases where the function outputs some error. What is the advantage of using do,try, catch over an "if else" in this case. Is it that it makes the code looks better of is there some benefit in actual speed of execution or something like that ?
@saurabhtripathi5718
@saurabhtripathi5718 5 жыл бұрын
hey please make more videos on interview question and answers.
@nileshpol5098
@nileshpol5098 6 жыл бұрын
Great.. I’d expect if you include odd scenarios too, at the end of each video
@karenkarapetyan6332
@karenkarapetyan6332 6 жыл бұрын
Hi Sean. Thank you for the great tutorial. Is there a way to throw nothing in a function that throws? e.g (I don't want to create class or enum inherit from Error and return that object.)
@guillaumeramey
@guillaumeramey 5 жыл бұрын
I love the Alert handling, well done. But I discover the "class func", what is it ?
@mohsinkhan845
@mohsinkhan845 5 жыл бұрын
Very helpful video
@seanallen
@seanallen 5 жыл бұрын
Happy to help, Mohsin 👍
@barche75
@barche75 7 жыл бұрын
Awsome) Thanks a lot!
@seanallen
@seanallen 7 жыл бұрын
Glad you enjoyed it!
@KulturanCov
@KulturanCov 2 жыл бұрын
The thumbnail looked like a Nike commercial lol (do... try... catch)
@Asif_Siddique332
@Asif_Siddique332 6 жыл бұрын
Awesome!​
@ShashiKumar-rn3uz
@ShashiKumar-rn3uz 6 жыл бұрын
Hi Sean .your videos are awesome .teaching skills are great.Please upload some videos for Core Data,Fetch Controller,Fetching large no of records from API ,Writing into Core Data and Displaying them into Table View concurrently.Thanks In Advance.
@seanallen
@seanallen 6 жыл бұрын
Hey Shashi, Thanks for the kind words! Glad you're enjoying the channel. As for Core Data tutorials, I probably won't be doing that anytime soon. I've never used it, and I just haven't seen the adoption in my experience to make it worth while. From my experience here in Silicon Valley, it isn't used all that often on production level projects. (Don't get me wrong, I'm not saying it's NEVER used... just pretty rare).
@wensmusic8636
@wensmusic8636 2 жыл бұрын
Hi thank you for this video, I have never seen both enum error cases, and a do try catch being used in the same function, were you just giving an example of how to use both, or do you usually do that only when there is a throw included? I ask because I imagine that if there is a throw included inside of the function, we only really need to use a do try catch block and can print out the error to do displayed to the user and do not need the enum cases? does this make sense ? Which is preferred?
@nightlynewsreview5076
@nightlynewsreview5076 4 жыл бұрын
Great video, love the speed of your speech. I hate slow talkers!
@seanallen
@seanallen 4 жыл бұрын
Glad you liked it! I get a lot of comments that I talk too fast.
@radoslavradev8477
@radoslavradev8477 7 жыл бұрын
Beautiful !
@seanallen
@seanallen 7 жыл бұрын
Thanks Radoslav!
@pravin1015
@pravin1015 7 жыл бұрын
hey can u explain how to use nspredicate to filter strings
@GulamALI-ni4ot
@GulamALI-ni4ot 6 жыл бұрын
love u brother from another mother !!
@seanallen
@seanallen 6 жыл бұрын
Glad you liked it!
@ravimaharjan2744
@ravimaharjan2744 5 жыл бұрын
Is there a way to define error messages in enum and just use one catch and throw relevant error message ?
@fakeme87
@fakeme87 6 жыл бұрын
Thanks for all your work on your channel! Quick question: could we instead of catching each error separately have a single ´´´catch let error { ... } ´´´ and do a switch on the error property inside?
@seanallen
@seanallen 6 жыл бұрын
I've actually never implemented it that way, but that sounds viable. Huge disclaimer... I haven't researched that and could be wrong. I would need to dig into it a bit more, but off the top of my head, it sounds alright.
@thatmark88
@thatmark88 7 жыл бұрын
Hey Sean, very nice tutorial, just download code . I wonder how did you setup the constraint of the all ui elements, did you setup constraint for each ui element, or you use suggested constraint for all. Maybe a tutorial about view constraint next time?
@seanallen
@seanallen 7 жыл бұрын
I set up the constraints for each UI element individually in the storyboard. A how to video for constraints is high on my list of videos to make.
@danzaverdk
@danzaverdk 5 жыл бұрын
Hi Sean, I'm a beginner in Swift, and I'm wondering how did you able to use the function in class Alert without instantiating it? or i just overlooked it somewhere? sorry for newbie question..
@erickramones2167
@erickramones2167 4 жыл бұрын
is it possible to put the enum in a separate file? I just started learning swift.
@alvolante2990
@alvolante2990 3 жыл бұрын
Really helpful vídeo man I Man doing a Udemy course but they don’t explains this that well
@seanallen
@seanallen 3 жыл бұрын
Glad you like my teaching style. These are some of my older videos and I've actually gotten a lot better. If you're not happy with Udemy courses, I started creating courses at seanallen.teachable.com if you want to check them out. You can watch the first ~10% of each one as a free preview.
@OnionKnight541
@OnionKnight541 4 жыл бұрын
The question I'm sure many have is: why use this instead of *if / else* statements? What is the actual advantage of using Do Try Catch?
@edwincreator2855
@edwincreator2855 6 жыл бұрын
why there is a double if statement, why if else is not use instead ?
@yaroslavlvov9481
@yaroslavlvov9481 7 жыл бұрын
Nice! But forgot to mention the try! And try? There some cases to use it as well
@seanallen
@seanallen 7 жыл бұрын
Hey Yaroslav, thanks for the feedback. I didn't forget about Try! and Try? I just decided no to discuss them for a couple of reasons. 1. The video was already getting a little long 2. The topic of the video is Error Handling in a Do, Try, Catch block. When using Try! and Try?, you are essentially choosing to not handle the errors so it wasn't 100% on topic. The combination of those 2 reasons are why I decided to cut that topic.
@AriMunandar
@AriMunandar 7 жыл бұрын
Hi Sean, What's best architecture for developing longterm product? Now i'm using Viper for my product.
@seanallen
@seanallen 7 жыл бұрын
I've really only used MVC, and payed around with MVVM so I'm a bit biased towards MVC. My thought's on this subject are that it's a personal preference and would depend on your team and the project. Certain architectures may be better for certain projects.
@murad3460
@murad3460 7 жыл бұрын
Hey! Do you suggest using storyboards or doing everything programmatically in big projects?
@seanallen
@seanallen 7 жыл бұрын
I think this comes down to personal preference. They both have their pros and cons in my opinion. Storyboards can be a pain when working with a team due to merge conflicts and code review. However, I prefer using Storyboards because I don't like "clutter' in my code. And all the UI and auto layout code can clutter up a file in my opinion. But again, it's personal preference. If you're just learning, you'll learn a lot more by doing your UI in code. However, once you understand what's going on, doing your UI in storyboard is cleaner in my opinion.
@sophiemccarthy1341
@sophiemccarthy1341 7 жыл бұрын
Hey Sean. As a beginner, I'd like to ask you something. When you started learning, did you focus on the language alone (swift) and OOP concepts, and then moved to more core issues like algorithms? Is there any tip you could give me as a beginner? What would be the best way to learn swift and get better understanding of OOP?
@seanallen
@seanallen 7 жыл бұрын
Hey Sophie, I started learning the language and OOP concepts first. I didn't get around to data structures and algorithms until it was time to apply for an iOS Developer position. And that was mainly because you need to know that stuff more so for the interview than the actual job. So as a beginner, I would definitely focus on learning Swift, the language, as well as basic OOP principals. I would start by doing tutorials on raywenderlich.com and then start building small apps on your own. I'm a big believer on "learning by doing", and you'll learn a lot when you try to build your own app idea.
@tonyferber3252
@tonyferber3252 6 жыл бұрын
I am learning too, one thing I think is important is to be able to speak in the Swift language and not use terms like "this", "that" and "stuff". Everything has it's own name like "variable", "operand", "nil coalescence" etc..
@NikeTao
@NikeTao 7 жыл бұрын
Is the isValidEmail extension written in a mix of Swift and Objective C? The emailFormat looks akin to it
@seanallen
@seanallen 7 жыл бұрын
Nope, it's all in Swift. The weird syntax you see is the Regular Expression stuff. But it's all in Swift.
@oTarrell13o
@oTarrell13o 5 жыл бұрын
Sean, what your methodologies when coding? I feel that some times I get lost in code because I don't have a general sense of direction when a problem may arise. I'm trying to get better, typically would write python scripts but now that I am getting into this type of development and using more and more files such as classes to fulfill the application its hard planning. It can kinda be discouraging but I feel like its something common and all you need is the right sense of direction when stuck.
@seanallen
@seanallen 5 жыл бұрын
I know what you're saying. It was overwhelming at first. To be honest, there's not really an easy answer. It's something I've developed over a couple years, and I'm still building. (Talking about my methodologies). They are constantly evolving and improving. Coming up with how you like to structure your apps is something that comes with time an experience.
@salvatorecastelluccio4901
@salvatorecastelluccio4901 5 жыл бұрын
When an iOS job applicant is at an onsite interview are they generally allowed to bring a paper notebook or iPad to use as a reference during the coding exercises? (algorithms excluded)
@seanallen
@seanallen 5 жыл бұрын
I've never seen that allowed.
@ladahavlik8054
@ladahavlik8054 7 жыл бұрын
Hello Sean, if I understood try catch is only for throwable methods. But how I can catch error from nonthrowable function or method. Example: let a = String(data: someData, encoding: .utf8) . Some times it it crash and application crash. Can I catch this error? Thank you.
@seanallen
@seanallen 7 жыл бұрын
In the example you provide, functions like that from Apple often return an optional. The reason it's crashing for you is because you're not unwrapping the optional correctly. So when the result of that function is nil, you'll get a crash.
@bartoszdolewski4915
@bartoszdolewski4915 7 жыл бұрын
If this is real life situation then IF statements would be changed for GUARD, right? Is there a practical difference between those two ?
@seanallen
@seanallen 7 жыл бұрын
It would depend on the situation. The main reason you would use GUARD is if you wanted to exit the function as a result of the "failed" guard. Guards provide an "early exit" from the function if you want it.
@thebrandontyler
@thebrandontyler 7 жыл бұрын
Can I ask about the regular expression for the email validation? I see that [A-Z0-9a-z._%+-] means any of those characters in the brackets and the + means one or more times, then you have the @ symbol which makes sense. After the @ symbol, you have [A-Za-z0-9.-]+ which is basically the same thing as above without a few of the special characters. My question starts here: \\. I know that \. means "." because it has to escape, but why the extra "\"? I think I also understand the end: [A-Za-z]{2,64} means A-Z and/or a-z anywhere from 2 to 64 times, right? Thanks! This is really helpful; it's the first time I've seen regular expressions in Swift and honestly didn't know it was possible before this video.
@seanallen
@seanallen 7 жыл бұрын
Hey Brandon, I'm not gonna lie and act like I fully understand all the ins and outs of regular expressions. It's a tricky topic to wrap your head around. I got this code snippet from a senior iOS dev a couple years ago and have been using it every since. Sorry I couldn't be of more help, but I would have to do more research before answering correctly.
@dev888www6
@dev888www6 5 жыл бұрын
Hello guys ! Did you find the answer to this question? Thank you!
@gillesashley9314
@gillesashley9314 2 жыл бұрын
Bro u are too good. How long have u been coding swift ?
@seanallen
@seanallen 2 жыл бұрын
Since early 2015
@gillesashley9314
@gillesashley9314 2 жыл бұрын
@@seanallen wonderful. How many hours a day? Anyways I followed u on Twitter.
@rahulbandal9185
@rahulbandal9185 7 жыл бұрын
Nice video again,sean how we can implement pager in ios like android
@seanallen
@seanallen 7 жыл бұрын
I've never used an Android phone, so I'm not sure what behavior you're talking about.
@rahulbandal9185
@rahulbandal9185 7 жыл бұрын
Its Like tab bar in ios ,Match with watsapp app what they used instead of tab bar in android
@adityabantwal
@adityabantwal 7 жыл бұрын
It is kind of like a scroll view. link-developer.android.com/training/animation/screen-slide.html.
@seanallen
@seanallen 7 жыл бұрын
Ok, now I get it. Looks like a scroll view or UIPageViewController in iOS.
@adityabantwal
@adityabantwal 7 жыл бұрын
Hi, Can you provide a starter project along with full source code.
@seanallen
@seanallen 7 жыл бұрын
That's a good idea, Aditya. I'll start doing that.
@Olden2610
@Olden2610 6 жыл бұрын
Hi Sean! Have a question: In case - we don't need error (wich in catch block) - can we use something like: let isLoggedIn = try? login() ?? false (login() returns true in case of success)?
@seanallen
@seanallen 6 жыл бұрын
I'm not sure of the exact code you're looking for, but in general, if you're not going to handle the error then you don't need to full do, try, catch block;
@Olden2610
@Olden2610 6 жыл бұрын
Actually - in case of some code throws an error - you have to deal it with do try catch block.
@stevengao8345
@stevengao8345 7 жыл бұрын
hello, you variable isValidEmail : bool , then put the { } , what is this, you add a closure behind it, so it will be executed everytime ? sorry i am a newbie, see this sometimes, don't know wut it is officially called ?
@seanallen
@seanallen 7 жыл бұрын
This is called a "computed property". Which means the property isn't a set value, like for example "var myNumber = 1". In that case, "myNumber" is always 1 (unless you change it). In a computed property, the value needs to be figured out. It's figured out by whatever logic you write in the {}
@stevengao8345
@stevengao8345 7 жыл бұрын
thank you, very clearly explained.
@ben6
@ben6 3 жыл бұрын
What is really confusing about Swift syntax here is the implicit `error` inside the catch block, when you might already have an error defined above.
@BRBallin1
@BRBallin1 4 жыл бұрын
Great content, but feel like they should be supplemented with examples of how they are applied within the context of iOS development similar to this video
@lukewazea2k7
@lukewazea2k7 6 жыл бұрын
imo it would be better to handle the title and message of the error inside the error enum, that way you can just call the alert message once. Nevertheless, probably the best video I've come across on error handling.
@seanallen
@seanallen 6 жыл бұрын
Good point. Thanks for the kind words, Luke!
@sashakolsky
@sashakolsky 6 жыл бұрын
Can you give me an example of how would you pass both title and message with enum value? I can add an associated rawValue, but only of a simple type (Int, String, Bool), but not a dictionary like: [String:String] Here is the only thing I could come up with, which is a bit ugly, imho: enum LoginError: String, Error { case incompleteForm = "Incomple Form:Please fill out both email and password fields" case invalidEmail = "Invalid Email Format:Please make sure you format your email correctly" case incorrectPasswordLength = "Password Too Short:Password should be at least 8 characters" } do { try login() // Transition to next screen } catch let error as LoginError where [.incompleteForm, .invalidEmail, .incorrectPasswordLength].contains(error) { let errorMessage = error.rawValue.split(separator: ":") Alert.showBasic(title: String(errorMessage[0]), message: String(errorMessage[1]), vc: self) } catch { Alert.showBasic(title: "Unable To Login", message: "There was an error when attempting to login", vc: self) }
@fikretsengul6214
@fikretsengul6214 6 жыл бұрын
I'm also curious about this question. If Mr. Allen can enlighten us it would be great.
@emrahkorkmaz3991
@emrahkorkmaz3991 6 жыл бұрын
You must use tuples, and you can man.
@chaudhryumair5380
@chaudhryumair5380 5 жыл бұрын
great
@seanallen
@seanallen 5 жыл бұрын
Thanks!
@yogeshnewpanay8613
@yogeshnewpanay8613 2 жыл бұрын
bro i have a request that i feel that once in a week for an hour you should interact with us for our queries or doubt if you can give one hours of your precious schedule it will be pleasure for us waiting for yours zoom , google meet link
@smarter2610
@smarter2610 5 жыл бұрын
sean, when variable looks like yours : var isValidEmail : Bool { ..... return ..} Is this a computed property or what?
@seanallen
@seanallen 5 жыл бұрын
Yup, that's a computed propery
@smarter2610
@smarter2610 5 жыл бұрын
@@seanallen Anyway, do you think that trying to get into ios carreer is a good idea in present times? I want to try send come resume in next month in my country(Poland). I don't know how market look like. Unfortunately i don't see so many offers;/ at least in my area
@aniltodakar6449
@aniltodakar6449 6 жыл бұрын
Sir, What is a helper method?
@seanallen
@seanallen 6 жыл бұрын
Basically a method that takes a small tasks and puts it into it's own method. Even tho this is just a 30 second preview, the video description and transcript should give you an idea: teamtreehouse.com/library/helper-methods
@aniltodakar6449
@aniltodakar6449 6 жыл бұрын
can you make a video on helper method please.
@AshutoshSingh-vm6jy
@AshutoshSingh-vm6jy 7 жыл бұрын
Hey Sean why we use " static var"
@seanallen
@seanallen 7 жыл бұрын
Here's a great, concise explanation: www.hackingwithswift.com/read/0/18/static-properties-and-methods
@AshutoshSingh-vm6jy
@AshutoshSingh-vm6jy 7 жыл бұрын
Thanks
@abdurehmanfarooq9845
@abdurehmanfarooq9845 Жыл бұрын
using api is not that easy i am stuck on it can you explain it for us as i am a beginner
@seanallen
@seanallen Жыл бұрын
I have a video coming out in a few weeks called "Network Calls for Beginners". Keep an eye out...
@abdurehmanfarooq9845
@abdurehmanfarooq9845 Жыл бұрын
@@seanallen thanks in advance
@ssaguiar
@ssaguiar 6 жыл бұрын
Thanks for your video. I wih to ask one thing: How can I implemente an error handling in the code below? Presently it doesn't work because it doesn't throws errors. It gives these warnings, in xcode: No calls to throwing functions occur within 'try' expression and 'catch' block is unreachable because no errors are thrown in 'do' block Thank you for any help, if possible. DispatchQueue.main.async { do { self.name.text = MyAccountViewController.nameofuser self.email.text = MyAccountViewController.email self.sessions.text = "\(MyAccountViewController.active_device_sessions)/\(MyAccountViewController.max_devices_sessions)" self.plan.text = MyAccountViewController.userplan try MyAccountViewController.used_disk_space = ByteCountFormatter.string( fromByteCount: Int64(MyAccountViewController.used_disk_space)!, countStyle: ByteCountFormatter.CountStyle.file ) try MyAccountViewController.max_disk_space = ByteCountFormatter.string( fromByteCount: Int64(MyAccountViewController.max_disk_space)!, countStyle: ByteCountFormatter.CountStyle.file ) try self.space.text = "\(MyAccountViewController.used_disk_space)/\(MyAccountViewController.max_disk_space)" } catch let e { debugPrint("failed to get user data: \(e)") } }
@seanallen
@seanallen 6 жыл бұрын
Hard to say just by looking at the code in a KZfaq comment. I'd have to play around with it in Xcode to debug it.
@gjermundification
@gjermundification 6 жыл бұрын
This video has some gems 0:44, 1:55, 10:15 and maps this up to the GUI here: 12:18 and as an added bonus "Feel free to steal this:" 11:39
@seanallen
@seanallen 6 жыл бұрын
Thanks for the kind words, Gjermund.
iOS Concurrency and Threading - iOS Interview Question - Swift
7:50
EVOLUTION OF ICE CREAM 😱 #shorts
00:11
Savage Vlogs
Рет қаралды 12 МЛН
Best Toilet Gadgets and #Hacks you must try!!💩💩
00:49
Poly Holy Yow
Рет қаралды 22 МЛН
Ouch.. 🤕
00:30
Celine & Michiel
Рет қаралды 27 МЛН
How to handle errors in functions - Swift for Complete Beginners
11:16
Filter, Map, Reduce - Swift - iOS Interview Questions
11:08
Sean Allen
Рет қаралды 53 М.
Swift Closures Explained
14:23
Sean Allen
Рет қаралды 62 М.
Whiteboard Coding Interviews: 6 Steps to Solve Any Problem
15:18
Fullstack Academy
Рет қаралды 364 М.
API vs. SDK: What's the difference?
9:21
IBM Technology
Рет қаралды 1,4 МЛН
How to use Do, Try, Catch, and Throws in Swift | Swift Concurrency #1
26:34
JPEG is Dying - And that's a bad thing
8:09
2kliksphilip
Рет қаралды 114 М.
Swift Access Control Explained
9:44
Sean Allen
Рет қаралды 33 М.
EVOLUTION OF ICE CREAM 😱 #shorts
00:11
Savage Vlogs
Рет қаралды 12 МЛН