This is most productive youtube channel i have ever found.Thankyou kyle.
@Kilo_Loco6 жыл бұрын
Glad you like it. This past week has been an experiment though. I do plan on continuing to put out content, but my experiment has given me insight as to what type of content I should focus on and how often I should produce it.
@alifarhadi57045 жыл бұрын
The best explanation for lazy property that I have seen on KZbin. Thanks
@MrDonhekel5 жыл бұрын
also Lazy computed properties are only calculated once when they’re first accessed.
@MrBhupeshpruthi3 жыл бұрын
Thanks for simplifying things..Your videos are always helpful..
@phanikella87694 жыл бұрын
the best explanation for lazy property... thanks kyle 🙂
@JasonMitchellAZ4 жыл бұрын
Great demo showing how ‘lazy’ works
@alirezaaj19576 жыл бұрын
such a good topic, and specially explanation and example . that was an eye opening video about lazy and it's usage . one reason that i really like most of your videos is because , when you try to talk about a topic, you share all useful experiments that you have gained and extract of them and pitfalls and tips . thanks a lot Kilo
@Kilo_Loco6 жыл бұрын
Really glad you feel that way about the content. If you truly like the channel, please share it with as many people as possible 😇
@Kilo_Loco6 жыл бұрын
Really glad you feel that way about the content. If you truly like the channel, please share it with as many people as possible 😇
@rasheedm20845 жыл бұрын
This video clarified the benefit of Lazy in great way .. thanks Kilo
@Kilo_Loco5 жыл бұрын
Glad I could help you out 😊
@david-tracy5 жыл бұрын
At 8:00, in the ibaction, what if we put that code in the background thread so we could interact with the ui still.... and say we had initialized the service in viewDidAppear instead of viewDidLoad to gain the fast startup but get a head start on the process too... My question is - what could we do to stop that looping service if we decided to navigate to a different screen before the looping service completed? Thanks fam
@AdelUI6 жыл бұрын
Kilo loco , crate a realm application using api and realm , EX : news app So next month , i'll support you in u're website . You're the best
@Kilo_Loco6 жыл бұрын
This video might be helpful if you’re looking into realm kzbin.info/www/bejne/nnSZlX-Cl8uIjsU I will also be covering how to save data from an api soon trello.com/c/wq9xUKui
@saibalaji47134 жыл бұрын
Thank you sir 😊
@Kilo_Loco4 жыл бұрын
always a pleasure
@_Forever5554 жыл бұрын
Can it be used to get the last result of db call in a asynchronous function?
@jacktoddy97835 жыл бұрын
Great video - really useful to build into my App = Many thanks.
@vincentjoyhere5 жыл бұрын
Thanks for the video. Really informative.
@DesperadoAH6 жыл бұрын
Nicccce I was using it but didn't know about everything, thank you KL
@Kilo_Loco6 жыл бұрын
My pleasure 😇 If there’s anyway to make my content better or if there’s a topic you want covered, please let me know.
@GG-hk5iz5 жыл бұрын
Hey Kyle Can you please explain what is purpose or how adding lazy in closure eg u did in imageView is beneficial in same way as u explained very well for expensiveNumber
@gjermundification6 жыл бұрын
9:13 Do any of you know where in the Swift documentation does it explain why a closure requires trailing ()? I assume it's called execute anonymous function.
@Kilo_Loco6 жыл бұрын
I didn’t mention it until 13:13 . Idk where it says that in the documentation, probably under lazy, but essentially since it’s a closure that actually needs to be executed right then and there, that’s why we have to have the () at the end.
@gjermundification6 жыл бұрын
Kilo Loco You are a naturist! Or should I say natural? I assume so too, hence I’d like to read the official documentation. It’s done more or less the same in ECMA Script.
@Kilo_Loco6 жыл бұрын
By all means check the documentation. You don’t really have to though because if you try to write out a lazy property by setting it to a closure without the () I think it throws a compile error anyways
@VeryBlueBot4 жыл бұрын
Very clear and useful thanks! Quick question: So from my understing, you wonldn't use `lazy` on variables you need in `viewDidLoad` right? As they mite be not ready when `viewDidLoad` triggers? Am I understanding this right? Thanks again! happy to find your channel
@Kilo_Loco4 жыл бұрын
you can use them in viewDidLoad too. they will simply be created during that lifecycle event
@VeryBlueBot4 жыл бұрын
@@Kilo_Loco So if Im using a variable that is not populated/initiated yet (time heavy async result) in viewDidLoad won't I get an error? Assuming Im not checking if its not nil? in any case I wont be able to use the response content as it is not existing yet. Lets say its a really big http request that takes a couple of seconds to complete and viewDidLoad is firing ... Or... viewDidLoad is firing only after everything is loaded? Including lazy variables?
@lucienchu96495 жыл бұрын
Nice explanation. I am new to Swift, so there are many new stuff here. Self, lzay, weak, some closure stuff, when should I used them what they are potential problems. Still struggling with them. THX
@Kilo_Loco5 жыл бұрын
You might find these videos helpful kzbin.info/www/bejne/j6LLp4mvnqqjf5I kzbin.info/www/bejne/rIS3ZYiEadhkock
@GoingWalkabout5 жыл бұрын
Thx, great example you are giving here.
@Kilo_Loco5 жыл бұрын
No problem! I always try to make things as clear as possible
@davidandreasson14346 жыл бұрын
THANKS, just thanks! I knew this, but It wasn't obvious for me! Now it is!!
@Kilo_Loco6 жыл бұрын
It's my pleasure to add another tool to your tool belt 😉
@TheAhmadReza6 жыл бұрын
Awesome! Could you pease include a link of you'r Xcode color theme file ?
@Kilo_Loco6 жыл бұрын
As of right now I don't have a link to it but I plan on having a page setup on kiloloco.com that will allow people to download the theme in the near future.
@piotriosdev41585 жыл бұрын
Hi Kilo! You’ve got nice xcode’s colors. Could you give me please an information what colors do you use in xcode?
@Kilo_Loco5 жыл бұрын
You can get the theme from here kiloloco.com/store
@piotriosdev41585 жыл бұрын
thx!
@Kilo_Loco5 жыл бұрын
It’s my pleausre
@vivekgarg89446 жыл бұрын
Hi Kilo thnks for the video. Can you plz explain other usages of "lazy" keyword.
@Kilo_Loco6 жыл бұрын
Using lazy for expensive functionality and for grouping code together are my primary uses for it. Not really sure what else lazy would be used for outside of that.
@vivekgarg89446 жыл бұрын
@@Kilo_Loco Thanks for the reply Kilo. I read somewhere that we can use Lazy keyword in Higher-order functions. I wish I could explain to you but they are not clear to me as well. I'll definitely share with you whenever I'll find them.
@Kilo_Loco6 жыл бұрын
Well higher order functions usually loop through all the items in collection. I suppose you could access your lazy variable inside the higher function in the event that you want to do something expensive on certain items in the collection. It really comes down to the same concept though. I wouldn’t really be able to give a relevant example myself since this would be a very particular use case that most developers would face. I know I haven’t come across something like this before
@belafekete31256 жыл бұрын
Thanks Kyle!
@Kilo_Loco6 жыл бұрын
Always a pleasure 😊
@adamkenton25856 жыл бұрын
Hey man nice video, and I really like your color scheme, how is it called ?
@Kilo_Loco6 жыл бұрын
It’s a custom theme that I put together. I’m going to share it on kiloloco.com in the near future
@zehualin66866 жыл бұрын
Is there build time optimisation in Swift 5 for the lazy keyword? Because normally using the lazy keyword would increase your build time as it gets type checked, and you really only want to use the lazy keyword if the initialisation is too expensive.
@freerider63006 жыл бұрын
You can specify the type as Kilo did with the UIView, I assume
@Kilo_Loco6 жыл бұрын
So as I was demonstrating, the constant property would be initialized with the view controller so yea its too expensive. From my experience lazy doesn't increase build time and decreases in most cases.
@HarshitKumar-br3iz5 жыл бұрын
Awesome
@Kilo_Loco5 жыл бұрын
Thanks!
@siddharthtiwari48496 жыл бұрын
Thanks sir
@Kilo_Loco6 жыл бұрын
My pleasure. If there’s anyway to make my content better or if there’s a topic you want covered, please let me know.
@donathmm38816 жыл бұрын
Good Video
@Kilo_Loco6 жыл бұрын
Thanks. Glad you liked it
@jhgjhgjhfjyhgjhgj53856 жыл бұрын
ye next video about multithread
@Kilo_Loco6 жыл бұрын
Thanks for the suggestion. I will add that to the list of topics to cover trello.com/c/UTZF7hMb
@raimitis6 жыл бұрын
Lazy var usage is clear for expensive calculations, but still not clear for me why to use for views (how you made example). What is the difference between lazy var and var someImageView: UIImageView = {}()? Why I would use lazy for view component instead of simple var. Only case where I saw lazy benefit for view management was in case I would like to get view width or height. More info here: kzbin.info/www/bejne/ZqvYiHmYpMqnnpI
@Kilo_Loco6 жыл бұрын
lazy wouldn't give you any real gains in performance for views. As I demonstrated, its mainly a developer preference that allows you to configure your views all in one place as opposed to having that code spread out across your view controller. Since your views are likely to be put on the screen before the view will appear, you'll actually see no gain at all.
@raimitis6 жыл бұрын
@@Kilo_Loco That is what I wanted to hear! Thank you!
@Kilo_Loco6 жыл бұрын
No problem 😁
@adinolivier6 жыл бұрын
You should have more views seriously
@Kilo_Loco6 жыл бұрын
Thanks! I’m really working hard on delivering content that is valuable to people. Any videos that you find valuable, please share them so they can help more people.
@vishnusatheesh66456 жыл бұрын
Adaptive designing
@Kilo_Loco6 жыл бұрын
Thanks! If there’s anyway to make my content better or if there’s a topic you want covered, please let me know.
@vishnusatheesh66456 жыл бұрын
Kilo Loco static method , file private etc
@Kilo_Loco6 жыл бұрын
Hope you find this helpful State & Class kzbin.info/www/bejne/eYeTlK2Cqsp6m6s Access Control kzbin.info/www/bejne/iWjGpGmkirepfZI
@maximkrouk16975 жыл бұрын
Would be cool if you make a video about advanced custom vc transitions, like in AppStore for ex (without snapshots, just real views), guess i’ve never seen such a video) (Here is one at raywenderlich.com, but they use a snapshot)