Skip to main content

Posts

Access Control by using Access Specifiers

Access Control by using Access Specifiers  iOS Developer level :  Intermediate   Configuration when this article was written   Xcode :  Version 11.5 MacOS :  10.15.5 (Catalina)   A working example Final code can be found in the  Resources  section below.   Access control  restricts access to parts (like functions, class, structure, variables …. etc ) of your code from code in other source files and modules.   So lets understand what do we mean by Modules and Source Files  before we head forward   Modules and Source Files   A  module  is a single unit of code distribution—a framework or application that is built and shipped as a single unit and that can be imported by another module with Swift’s  import  keyword. In the example below (which I will coverup shortly) SharedFunctionality is a Module   A  source file  is a single Swift source code file within a module (in effe...