App Crashes on setSelectedIndex Method call programmatically to select an index.
amit2908 opened this issue · 1 comments
amit2908 commented
In file RAMAnimatedTabBarController+BottomLine.swift
`func setBottomLinePosition(index: Int, animated: Bool = true) {
guard let itemsCount = tabBar.items?.count, itemsCount > index,
let currentItem = (containers.filter { $0.value.tag == index}).first?.value else { return }
lineLeadingConstraint?.isActive = false
lineLeadingConstraint = bottomLine?.leadingAnchor.constraint(equalTo: currentItem.leadingAnchor)
lineLeadingConstraint?.isActive = true
if animated {
UIView.animate(withDuration: bottomLineMoveDuration) { self.bottomLine?.superview?.layoutIfNeeded()
// **App crashed on this line with EXC_BAD_ACCCESS(code=2, address=)**
}
} else {
self.bottomLine?.superview?.layoutIfNeeded()
}
}`
0ber commented
It works well, could you check the example https://github.com/0ber/AnimatedTabBar-Pod-Test/commits/master, commit 0ber/AnimatedTabBar-Pod-Test@ee81955