Tab bar appearance for iphone and ipad for both image and text color in normal and selected mode iOS swift

 Solution:

You can able to change the bar appearance for iphone and ipad for both image and text color in normal and selected mode 

        let tabBarAppearance = UITabBarAppearance()

        let tabBarItemAppearance = UITabBarItemAppearance()

        tabBarItemAppearance.normal.iconColor = color

        tabBarItemAppearance.normal.titleTextAttributes = [NSAttributedString.Key.foregroundColorcolor]

        tabBarAppearance.stackedLayoutAppearance = tabBarItemAppearance


        self.tabBar.standardAppearance = tabBarAppearance


The above code will works for iphone But in ipad you want to add the below code


        tabBarAppearance.inlineLayoutAppearance = tabBarItemAppearance



Comments

Popular posts from this blog

store cgpoint in userdefaults iOS swift

Invalid bundle error while upload the app to the app Store