Contents

Swift allows us to define more methods on existing class using extension.

If you ‘re afraid of the naming conflict, you can prefix your methods. Or a better way, reverse it :dancer: , like

This way, no more conflict and we make it clear that shake() and fade() belongs to animation category

Actually, animation and layout are properties in UIView extension. This may cause naming conflict, but the number of them is reduced

This is how it works

This is applied in Wave

Contents