4

How can I know the type of class of a delegate?

self.delegate.isKindOfClass() and self.delegate.isMemberOfClass() are not working.

When I print println(self.delegate) It prints the caller controller class. But I cant check it.

iRiziya
  • 3,235
  • 1
  • 22
  • 36
Sujisha Os
  • 1,311
  • 2
  • 11
  • 12
  • possible duplicate of [Using isKindOfClass with Swift](http://stackoverflow.com/questions/24019707/using-iskindofclass-with-swift) – Shamas S Aug 03 '15 at 08:37

1 Answers1

7

If you want to check if your delegate is kind of class use the following

if self.delegate is ExampleClass {

}
JulianM
  • 2,540
  • 18
  • 13