How to check if a Generic type is nil in Swift -
I am trying to copy all functions from Ajithan, to check any type of blue objects in a list Closed, but I have a hard time trying to check alternative items For some reason I can send an alternate string (for example string) and although it says that it is not zero it is still a statement Which passes through the function's arm No. Any advice about this or how to deal with it? Thanks!
func `all` & lt; T & gt; (Aray: [T]) - & gt; Bull {For the array in the item {if item is in any form? {Println (item) // nil>. & Lt; } Test: T? = Items if tested {println ("broken") // print is broken: (}} returning true} var t: string? All ([t])
It is not absolutely clear what you are trying to test, but it may help you.
The function should be the parameter array of options [t?]
This can be beneficial to compare these elements directly with zero
. Enough to close The filter
function can be found.
func all (Array: [t?]) -> Child {For element in the array} If element returns == zero {return false}}}
Comments
Post a Comment