0

My question is: is UItextInputTraits a protocol ?? if yes why does it have instances variables ?

Thanks

1 Answer 1

3

Yes it is a protocol, and no it does not have instance variables. It has properties, which are just syntactic sugar for methods.

A property does not need to be backed by an instance variable at all; not in a class definition or a protocol (in the latter it can't just by the nature of how protocols work). All it cares about is that, for instance, in the case of a protocol named foo two methods exist if it's readwrite:

- foo - setFoo: 

Obviously, returning and taking the appropriate data type.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.