Reputation: 47
I'm currently developing a iOS project and I was wondering what is the difference between checking "User Interaction Enabled" in the attribute inspector or setting ".userInteractionEnabled" to "true", is it a matter of best practices, does it even matter at all?
Thanks in advance guys,
Mathias
Upvotes: 0
Views: 132
Reputation: 1993
There is no functional difference.
It basically comes down to your preference, or the coding guidelines that are already in place in a project. As general advice, avoid mixing between the two alternatives as much as possible, because it makes code hard to maintain in the long run.
I follow the rule that all static setup is done through IB, and stuff that needs to change during runtime is set in code.
Upvotes: 4