mardi 26 juillet 2016

Swift Extensions

I am curious as to what is the purpose of writing extensions for a class that you can already add code?

For example, in Ray Wenderlich's AlamoFire tutorial,

He has a ViewController class, but he writes an extension for that ViewController for his Networking Functions and UIImagePickerControllerDelegate methods. Is the only reason he is writing extensions is for the purpose of dividing up code into logical bits?

Is this a common practice or just personal preference?

Aucun commentaire:

Enregistrer un commentaire