Skip to content

Commit

Permalink
resolved crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhruvik Dhanani committed Oct 12, 2024
1 parent 4e20172 commit 96b70a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions MagicTabBar/Source/CustomizeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,15 @@ extension CustomizeView {
self.finalArray.insert(item.dragItem.localObject as! String, at: indexPath.row)
if let index = self.additionalArray.firstIndex(of: item.dragItem.localObject as! String) {
self.additionalArray.remove(at: index)
customCollectionView.deleteItems(at: [IndexPath(row: index, section: 0)])
customCollectionView.reloadData()
}
}
else
{
self.additionalArray.insert(item.dragItem.localObject as! String, at: indexPath.row)
if let index = self.finalArray.firstIndex(of: item.dragItem.localObject as! String) {
self.finalArray.remove(at: index)
addMenuCollectionView.deleteItems(at: [IndexPath(row: index, section: 0)])
addMenuCollectionView.reloadData()
}
}
indexPaths.append(indexPath)
Expand Down
6 changes: 3 additions & 3 deletions MagicTabBar/Source/MagicTabBarViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class MagicTabBarViewController: UITabBarController, UITabBarControllerDelegate
custom.frame = CGRect(x: 0, y: tabBar.frame.origin.y, width: screenWidth, height: 80 + view.safeAreaInsets.bottom)
custom.reloadData(magicTab.map{$0.image})
self.show(custom)
UIView.animate(withDuration: 0.5, animations: { [weak self] in
UIView.animate(withDuration: 0.2, animations: { [weak self] in
custom.leadingOfBottomCollectionView.constant = -(0.25 * screenWidth)
custom.trailingOfBottomCollectionView.constant = 0.25 * screenWidth
self?.view.layoutIfNeeded()
Expand All @@ -81,15 +81,15 @@ class MagicTabBarViewController: UITabBarController, UITabBarControllerDelegate
/// Done Action
custom.doneAction = { [weak self] (data) in
self?.viewControllers = self?.setTab()
UIView.animate(withDuration: 0.5, animations: { [weak self] in
UIView.animate(withDuration: 0.2, animations: { [weak self] in
custom.viewWithTag(2020)?.alpha = 0
custom.heightOfUpperView.constant = 0
self?.view.layoutIfNeeded()
}) {[weak self] (_) in
custom.frame = CGRect(x: 0, y: self!.tabBar.frame.origin.y, width: screenWidth, height: 80 + self!.view.safeAreaInsets.bottom)
custom.setHeight(height: 80 + self!.view.safeAreaInsets.bottom)
self?.view.layoutIfNeeded()
UIView.animate(withDuration: 0.5, animations: {[weak self] in
UIView.animate(withDuration: 0.2, animations: {[weak self] in
custom.trailingOfBottomCollectionView.constant = 0
custom.leadingOfBottomCollectionView.constant = 0
custom.addMenuCollectionView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
Expand Down

0 comments on commit 96b70a8

Please sign in to comment.