CosmicMind / Material

A UI/UX framework for creating beautiful applications.
http://cosmicmind.com
MIT License
11.98k stars 1.26k forks source link

Enabling swipe effect on AppTabsController >> Line of current tab not going to be change while using swipe on tabs #1149

Closed shroff-kandarp closed 6 years ago

OrkhanAlikhanov commented 6 years ago

Hey! Can you share a minimal sample project replicating the issue?

shroff-kandarp commented 6 years ago

I found problem. self.tabBar.animate(to: self.tabBar.tabItems[index])

Add above line in function in file "TabsController.swift"

private func internalSelect(at index: Int, isTriggeredByUserInteraction: Bool) -> Bool { guard index != selectedIndex else { return false }

if isTriggeredByUserInteraction {
  guard !(false == delegate?.tabsController?(tabsController: self, shouldSelect: viewControllers[index])) else {
    return false
  }
}

### self.tabBar.animate(to: self.tabBar.tabItems[index])

transition(to: viewControllers[index], isTriggeredByUserInteraction: isTriggeredByUserInteraction) { [weak self] (isFinishing) in
  guard isFinishing else {
    return
  }

  self?.selectedIndex = index

}

}

OrkhanAlikhanov commented 6 years ago

Latest code is a little bit different, we have tabBar.select(at: index) there:

https://github.com/CosmicMind/Material/blob/c9fb3f6f3067ddc869ca6128b5e4e5a783075688/Sources/iOS/TabsController.swift#L399-L432

shroff-kandarp commented 6 years ago

Okay. Thanks. I have old version of this library.

OrkhanAlikhanov commented 6 years ago

The code I pointed is from development branch. It might not be in release

daniel-jonathan commented 6 years ago

Thank you @OrkhanAlikhanov. @shroff-kandarp if you have any further questions, or another issue, please reopen or create a new one. Thank you!