1 min readAug 24, 2020
Regarding your date extensions, creating Date and Number formatters are relatively expensive operations. If, for example, you're in a tableview and scrolling through a list that's showing a lot of dates you're constantly creating and destroying formatters.
Better to create one in a private global variable and share it between extensions. If you need different formats, make a couple and do toShortDate, toLongDate, etc..