DEV Community

Discussion on: Tags in Swift UIViews

Collapse
 
midhetfatema94 profile image
Midhet Sulemani

I have a customised video view and a fullscreen button in it. Both enter and exit fullscreen methods are linked to the outlet of the same fullscreen button. I toggle the tag of this button to 0 and 1 and according to its tag, I will decide whether to enter or exit the fullscreen. Is this an unreliable approach? If yes, then can you suggest a better one?

Collapse
 
gualtierofr profile image
Gualtiero Frigerio

Why not a Bool var like isFullScreen in your view controller? Seems more clear to me, you toggle the variable and you know what you have to do

Thread Thread
 
midhetfatema94 profile image
Midhet Sulemani

Thanks for the opinions :)