Alexito's World

A world of coding 💻, by Alejandro Martinez

🔗 Linked post

Check out the linked article.

Oficial answer to Protected acces control in Swift

The oficial Swift blog is giving us clarifications about Access Control and protected

It seems like it's their conscious decision to make an horizontal access control system instead of a vertical or hierarchy based.

Swift provides access control along a single, easy-to-understand axis, unrelated to inheritance. We believe this model is simpler, and provides access control the way it is most often needed: to isolate implementation details to within a class or within a framework.

There are other ways to accomplish the same thing that other languages do with protected. Apple is using it and we are using it also in Objective-C.

It may be different from what you’ve used before, but we encourage you to try it out.

If you liked this article please consider supporting me