Let\'s say that I have 2 public methods:
func didSelect(data: Data) {
// do something
self.view.showText(textForData(data))
}
func didDismiss(data: Dat
I think that the formatting of the data is an own responsibility. So you should extract it to its own class.
This class could be unit tested on its own.
Your other class(es) that use this one should be decoupled by using an interface instead of the class directly. The dependancy should be injected (for example in the constrcutor). You could write an default constructor creating the default class to simplify things in production code (poor mens dependency injection).
Then you could mock the formatter and test the other class(es) in isolation, verifying that the textForData method is called correctly.