I'm studying Swift and I have a question. When we make some button's Action function, sometimes tags are used. After all to set button's tags with code, we must connect button's Outlet from storyboard. Why use tags instead of outlet's variable name?
CodePudding user response:
Any number of buttons can have a single action and we then need tag to distinguish action based on button tag. you don't actually need outlet for each button if you are setting tag from storyboard, Here is a detailed articles about tags:
Working With Multiple UIButtons and Utilizing Their Tag Property
CodePudding user response:
Many cases many button have the same ibaction. In this situation , tag can help