WaveTab
WaveTab copied to clipboard
Tab bar circle not updating properly after showing or hiding side menu drawer.
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
- Add side menu drawer along with wave tab bar
- Click or slide to show or hide side menu.
- Tab bar not updating properly, when side menu hides.
Expected behavior Wave tab bar is working perfectly when I use only bottom tab bar but when I implemented the side menu or when I come back from another view controller, it's wave behaviour is not updating. It should work same on every condition not only for bottom tab bar.
Screenshots/Video Here is the video link for the same.
https://user-images.githubusercontent.com/35003745/151233944-896ad4de-81db-4f05-a8de-bc5d9b161474.mov

Smartphone:
- Device: Simulator iPhone 12 Pro Max
- OS: iOS 15.0
While circle and imageView is added to view just remove both from superview. it works for me!
func setupCircle(_ width: Float) { circle?.removeFromSuperview() // ->> Add this line circle = UIView(frame: CGRect(x: 0.0, y: 0.0, width: CGFloat(width), height: CGFloat(width))) circle?.layer.cornerRadius = CGFloat(width) / 2 circle?.center = CGPoint(x: tabBarItems[safeSelectedIndex].center.x, y: 0.0) tabBar.addSubview(circle!) }
func setupImageView(_ center: Float) { let image = viewControllers?[safeSelectedIndex].tabBarItem.selectedImage imageView?.removeFromSuperview() // ->> Add this line imageView = UIImageView(image: image) imageView?.contentMode = UIView.ContentMode.scaleToFill circle?.addSubview(imageView!) imageView?.center = CGPoint(x: CGFloat(center), y: CGFloat(center)) }
Thanks.
Fixed in This PR #8
@MrPrakashR thanks will check.