标签: ios swift user-interface
对标题感到抱歉,真的不知道怎么说这个问题。这是帮助的图片:
我希望能够将Notifications选项卡旁边的数字“5”变为变量,并且我正在努力这样做。 “通知”标签只是这个按钮
XCUIApplication().tabBars.buttons["Notifications"]
答案 0 :(得分:2)
每个UITabBarItem都有badgeValue
UITabBarItem
badgeValue
tabBarController?.tabBar.items?[3].badgeValue