Weak Variables
Sometimes you set up a relationship between two objects where each object needs to reference the other. (This could be as simple as two objects or as complex as a chain of objects that create a cycle.) For example, iOS applications present graphics on the screen through objects known as views. Views are maintained in a hierarchy. So one view might present an image, and inside that image view you might want to display a title for that image. You can set this up where the image view is the main view, and the title is a subview. When the main view is shown, the subview is automatically shown as well. You can think of the main image view as the parent view and the title view as the child view. The main image view owns the subview. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access