Extension in Swift

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](https://github.com/onmyway133/Wave)

Like what you read? Give Khoa Pham a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.