Programming, Swift, Object Oriented, Objective C.
By restricting access to data we prevent unexpected changes. Encapsulation instead exposes functions to operate on that data. Encapsulation restricts direct access to data and exposes functions to operate on that data. Here’s an example to demonstrate the concept. Say I’m working on a drawing app