ios - AnyObject property in Swift -
i have question property of anyobject in swift. have method anyobject variable. can check type it, example want perform operation on property regardless of type of variable (all possible types have same property). possible call varaiable?
in cases, anyobject
property mistake. protocol or generic right tool. example, if want perform operation "regardless of type" mean type has characteristic allow perform operation. characteristic (for instance, existence of property) best expressed protocol.
Comments
Post a Comment