Forum Xamarin Xamarin.iOS

Best way to access unique instances of ViewController's using UIView's tag field?

CharlieFinlaysonCharlieFinlayson USUniversity ✭✭
edited June 2016 in Xamarin.iOS

So currently I'll set this in an extended controller class:

this.View.Tag = 90059;

And then I'll retrieve the controller in another class using this property:

public UITabBarController MainTabBarController { get{ foreach (var child in ChildViewControllers) { if (child.View.Tag == 90059) { return child as UITabBarController; } } return null; } }

Is there a better way to do what I need? I wasn't able to set the UITabController's View's tag property in the designer either. It was un-clickable, even if document outline.

Sign In or Register to comment.