cs193p – Lecture #8 – Protocols, Blocks, and Animation

Please note, this blog entry is from a previous course. You might want to check out the current one.

Though lecture #8 starts with a huge theory part.

Protocols are a way of communication between unrelated projects, in iOS mainly used for delegates and data sources. A protocol declares which properties and methods can or have to exist in another class to be accessible by the declaring class.

Blocks encapsulate pieces of code which can be passed like objects. Special care has to be taken when the code inside blocks needs to access variables or objects outside the block.

Animating views can be done by animating its properties directly or – new in iOS 7 – physics based. When animating the properties of a view you provide the timing and the end state. For dynamic animation you define the physics of your view and its contents.

The end of the lecture is a demo explaining dynamic animation in more detail.

The code for this lecture is available at github as well as from Stanford.

The lecture as well as its slides are available via iTunes called “8. Protocols, Blocks, and Animation”.


Leave a Reply

Your email address will not be published.