This is interesting: it appears you can't call a selector message on a swift struct
! What I mean is this: I've got a struct
and want to implement a simple Timer
on it, using the variation of Timer.scheduledTimer
that takes a selector:
argument. The compiler tells me that the selector method being called needs an objc
attribute to make the method visible to an Objective-C calling sequence, but that's not supported (yet another helpful compiler message! ;-) for non-class objects.
I thought using a struct
was a better way to go in my particular case, but I guess I'm going to have to back-port it to a class
unless somebody has a better idea...