Swift Access Control Explained

preview_player
Показать описание
In this Swift tutorial I explain all the keywords for access control. We walk through private, fileprivate, internal, open and public with examples of each. I recommend using my video as an introduction to get the general idea of how these work, then move on to reading the documentation linked below for further understanding of access control in Swift.

This tutorial was built using Xcode 11 and Swift 5.1.

Access Control Documentation:

If you like my teaching style, I've released my first iOS dev course which is all about the take-home project job interview for iOS developers.

Link to my book - How I Became an iOS Developer:

Check out my podcast, iOS Dev Discussions:

I stream gaming content on Twitch:

Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):

Ray Wenderlich Books:

Ray Wenderlich Videos:

Paul Hudson's Hacking With Swift:

Learn Advanced Swift Here:

Links to my iOS Dev Setup & iOS Dev Book Recommendations

Personal Links:

Twitter:

Instagram:
@seanallen_dev
Рекомендации по теме
Комментарии
Автор

One of the reasons I purchased your “iOS Dev Job Interview practice” without even thinking, is your crystal clear way to explain things! Keep it up Sean!

christostsangaris
Автор

I had some doubts after reading the swift documentation, but you just cleared them out for me. Thank you again!

jeffbezos
Автор

Apple, please fix the "private" access control to also work in extensions that are in other files, not only in the same file with the declaration. 🤷‍♂️

Great video!

AcselRo
Автор

This is the video that i was looking for. Thank you Sean.

RizosKonstantinos
Автор

Thanks for the attention to this, go this in an interview asked.

robinandthedog
Автор

Hey look, you hit 50k subs - congrats! 🥳

JasonMitchellAZ
Автор

very important topic i got asked about this topic in my last interview, thank you sean

jameelshehadeh
Автор

Thanks Sean. I did not understand fileprivate.
Love your videos, good work

Greetings from Argentina

PatricioBenavente
Автор

Excellent tutorial! very clear explanation, thanks! Also, totally unrelated question but what software do you use to create these videos to essentially have Xcode UI & yourself on the same screen?

aishaoh
Автор

Excellent tutorial! very clear explanation, thanks!

farziinsan
Автор

Great video Sean, thanks a bunch! Always drill the basics, right 👍

KFrench
Автор

private(set) is kinda cool too. Gives you read only access, but is private for setters

snaky_pants
Автор

Thanks a lot. 
This video is really helpful and easy to understand. 👍👍👍

princekili
Автор

We need a `groupprivate` I think! Makes it private to a folder/group, similar to Java’s default access modifier.

georgeelsham
Автор

Thank you Sean for great tutorial about Access Control. As an addition I would also like to know about "final", where and why to use.

jasurrajabov
Автор

can u pls do more iOS interview questions? I ran through that playlist and the Swift Keywords playlist and need more of ur content bc this really sticks with ur explanations !! Thanks!!!

TheBlueSquirtle
Автор

Cool video, as always! As you said, it covers the basics more than enough.

One little nitpicky thing: I'm sad you didn't include "private(set)" - although I guess it's not a core part of access control, IMO it's a super useful feature!
(commenting mostly so that the few people who read comments might hear about it for the first time 😀 don't know if you omitted it on purpose)

honza_kriz_bass
Автор

So whats difference between Public and Internal?

mazedar_tv
Автор

Hi Allen...
I am requesting
Please upload setters and getters in swift
please do this video Allen

nareshy
Автор

Online tutorials should use and teach access control more often. Part of proper coding imho... thanks for the video!

gakkieNL