Swift 5: Anonymous Closures & Closures (Xcode 11) - 2020 - iOS Developer

preview_player
Показать описание
In this video we will learn about Anonymous Closures in Swift 5 using Xcode 11. Anonymous closures are a great way to configure static aspects of objects in one block.

#swift #closures #iOSDeveloper

Join this channel to get access to perks, code, groups, and more:

** Get Skillshare free for 2 Months and learn iOS

** Manage all your investments from app earnings on Betterment!

** Grow your own Youtube tech channel with TubeBuddy:
Рекомендации по теме
Комментарии
Автор

Actually assigning "self" to the addTarget of the button does not throw an error but will instead be a silent error. The way to solve it (which was not said in the video) is setting the variable into a "lazy var" instead of "let" because when the variable is used the "self" will refer to the actual class, not the closure.

JonathanBijos
Автор

Had seen this code multiple times but understood the reason and logic today . Thanks

GG-hkiz
Автор

Best tutorials on YouTube. One remark though, I left a similar comment before. Please make more playlists on your channel. For example this video cannot be found in any of your other video playlists, I deliberately looked for it (it took a while as I did not know where to look) only because you had mentioned about it in another video. But anyway you are the best

liangyanyang
Автор

You can actually use "self" for the addTarget method of a button within an anonymous closure, because it will be able to infer its type(UIButton).
Cannot use self to assign datasource inside an anonymous closure, because "self" is of a type UITableView, which doesn't confirm to its datasource delegate, hence the error which you got.

jyothishjohnson
Автор

Here from the passing data video. I love how you code your properties in the last video. Needed to see more. Here to find out why you would use this method.

JusCJay
Автор

Just found your channel and I must say thats its great. So much content to catch up on

iAmBeyondGreat
Автор

Another great video man! Are u think record video about RxSwift?

m.celaltok
Автор

I don’t like all that code at the top of my viewcontrollers, I prefer the orher way (and sub classing)

gakkieNL
Автор

I've used it tones of times and didn't even know what it's called.

Денис-жфр