As a general rule (YMMV):
- Are you adding universal functions that should be available to all
UITextField ? . If yes, do the extension. All instances of UITextField can call new methods. - Do you
UITextField functionality that should be limited to special instances of UITextField that you define exactly? If so, create a subclass. Only instances of the subclass can use new methods.
There are other technical considerations, for example, extensions cannot add fields, for example.
Jean-philippe pellet
source share