Posts

Showing posts with the label access levels

Treehouse Intermediate Course Part 9 (Access Levels and APIs)

Yes another one! That does that make it 5 in a row?! Anyway, today will be fairly brief as there's not much on this course. Then it will mean Intermediate Treehouse complete! I feel like I've got to grips well with certain concepts but am frustrated there wasn't more in practice. Once this is done I will be having a look over the Udemy ones. Right, onto Access Levels! Time started: 16:15 Access Control This is about restricting access to code in other files etc. So this links to Module. E.g. import Foundation etc. Whereas a swift file (ending in .swift) are source files. Open and Public access. UI View Controller - this has open access. Within a module, open and public function in the same way. Open is the least restrictive. Then public, then internal access. Internal access is the default level of access. Then it is 'file private'. You can reduce the access. Private is least open. So a private stored property can only be used within its class. ...