Ramotion / animated-tab-bar

:octocat: RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion
https://www.ramotion.com/animated-tab-bar-ios-app-development-ui-library/
MIT License
11.12k stars 1.33k forks source link

fatalError("add image icon in UITabBarItem") but image aleary added #163

Closed Astoration closed 6 years ago

Astoration commented 7 years ago
guard let itemImage = item.image else {
        fatalError("add image icon in UITabBarItem")
      }

Exception from this line

<tabBarItem
    key="tabBarItem"
    title=""
    image="footer_icon_02_00"
    selectedImage="footer_icon_02_00"
    id="LJR-hK-R4Q"
    customClass="RAMAnimatedTabBarItem"
    customModule="RAMAnimatedTabBarController">

However, every item on the storyboard has an image added What is the problem?

super.viewDidLoad()
        let items = tabBar.items
        for item in items!{
            let image = item.image!
        }

In addition, I've tested this code and I've definitely added an image

version information : 'RAMAnimatedTabBarController', '~> 2.0.13' / swift3

prakashRavi1990 commented 7 years ago

Have you got solution for this???

Astoration commented 7 years ago

Deleting the exception line will work normally. However, when the animation is not playing, the icon is not visible. In this case, the animation will be resolved by stopping the frame at the 0th index.

macro-dadt commented 6 years ago

make sure that you set custom image for Bar Item (not Tab Bar Item)