I know there's a "better" way to get this item that I want, but I'm not as adept yet at Swift's functional programming syntax.
I have a collection of things, they each have a property, I want to find the one with a tag of 1
on that property.
var homeController : UIViewController?
for vc in (tabBarController?.viewControllers)! {
if vc.tabBarItem.tag == 1 {
homeController = vc
}
}
What's your cleaner way to get to "give me the view controller with tab bar item tagged 1"?