iOS13之前修改的方法
//未选中颜色
NSDictionary * noselectedTitleColordic =@{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#666666"]};
[[UITabBarItem appearance] setTitleTextAttributes:noselectedTitleColordic forState:UIControlStateNormal];
//选中颜色
NSDictionary * selectedTitleColordic =@{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#24C678"]};
[[UITabBarItem appearance] setTitleTextAttributes:selectedTitleColordic forState:UIControlStateSelected];
iOS13 之后的方法
UITabBarAppearance *appearance = [UITabBarAppearance new];
UIImage *bgImage = [UIImage imageNamed:@"home_line"];
[appearance setShadowImage:bgImage];
[appearance setBackgroundImage:[UIImage qmui_imageWithColor:[UIColor whiteColor]]];
appearance.stackedLayoutAppearance.selected.titleTextAttributes = @{NSForegroundColorAttributeName::[UIColor colorWithHexString:@"#24C678"]};
board.tabBarItem.standardAppearance = appearance;