ios - Swift class extension with protocol vs conforming to protocol -


in this tutorial, author uses extension flickrphotosviewcontroller: uitextfielddelegate , implements protocol method. have tested , author have done class flickrphotosviewcontroller: uicollectionviewcontroller, uitextfielddelegate , implemented methods in class. difference can see makes easier read , understand. design style or something?

is design style or something

very so. normal style separate class multiple extensions, each expressing class's adoption of 1 or more related protocols. separation has no functional meaning; class could have been expressed without separation.


Comments

Popular posts from this blog

android - questions about switching from C2DM to GCM -

c++ - Qt setGeometry: Unable to set geometry -

batch file - How to extract all multi-volume RAR archives from subfolders of a folder? -