Saturday, 15 June 2013

syntax - How do I check if a var is a Tuple in Swift? -


type the casting section and see if I'm using the keyword for the check code I am using.

  Funk string (Test: an object?) - & gt; It seems that when I'm checking the tubes containing three NSNumber objects, I think that 'Tuple does not correspond to the protocol  AnyObject << code>  

/ Code> '. Is there any way to check that there is a tube in a variable?

  func isTuple (test: AnyObject?) - & gt; Bool {Return Examination (NSNM, NSNM, NSNM) // Error}  

It can not be used here because there is not an example of a class type.

  • AnyObject can represent an instance of any type of class.
  • Any type

    to

    Instead, Type more any :

      func isTuple (test: any?) - & gt; Bull is the return test (NSNM, NSNM, NSNM)} TIPAL ("TEST") / Lies: (NSNM, NSNM, NSNM) = (int (), int (), int ()) TIPL / / True  

No comments:

Post a Comment