I have some Obj-c code that is working fine but I'm wondering if it utilizes an 'anti-pattern' and if there is an obvious better route that someone more experienced might take.
- ViewController1 is acting as the delegate for an object instantiated from a third party library. It is in the foreground.
- ViewController2 is coming to the foreground. During the segue, in
prepareForSegue, ViewController1 sets the delegate of the object that it is currently acting as the delegate for to ViewController2, such that any subsequent delegate calls are received on ViewController2 while it is in the foreground.
This works. And it doesn't bother me too much. But it feels likes something where there might be a more idiomatic solution.
Aucun commentaire:
Enregistrer un commentaire