Merge remote-tracking branch 'origin/develop' into feature/behavior_expansion
This commit is contained in:
commit
8aae29de40
@ -80,6 +80,7 @@
|
|||||||
|
|
||||||
// MARK: - UITabBarDelegate
|
// MARK: - UITabBarDelegate
|
||||||
public func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
|
public func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
|
||||||
|
guard item.tag != tabBar.selectedItem?.tag else { return }
|
||||||
self.model.selectedTab = item.tag
|
self.model.selectedTab = item.tag
|
||||||
Button.performButtonAction(with: model.tabs[item.tag].action, button: item, delegateObject: delegateObject, additionalData: nil)
|
Button.performButtonAction(with: model.tabs[item.tag].action, button: item, delegateObject: delegateObject, additionalData: nil)
|
||||||
}
|
}
|
||||||
@ -95,7 +96,8 @@
|
|||||||
|
|
||||||
public func selectTab(at index: Int) {
|
public func selectTab(at index: Int) {
|
||||||
MVMCoreDispatchUtility.performBlock(onMainThread: {
|
MVMCoreDispatchUtility.performBlock(onMainThread: {
|
||||||
guard let newSelectedItem = self.items?[index] else { return }
|
guard index != self.selectedItem?.tag,
|
||||||
|
let newSelectedItem = self.items?[index] else { return }
|
||||||
self.selectedItem = newSelectedItem
|
self.selectedItem = newSelectedItem
|
||||||
self.tabBar(self, didSelect: newSelectedItem)
|
self.tabBar(self, didSelect: newSelectedItem)
|
||||||
})
|
})
|
||||||
|
|||||||
@ -21,6 +21,8 @@ public extension MoleculeModelProtocol {
|
|||||||
static var categoryCodingKey: String { "moleculeName" }
|
static var categoryCodingKey: String { "moleculeName" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Helpers made due to swift not able to reconcile which category.
|
||||||
extension KeyedDecodingContainer where Key: CodingKey {
|
extension KeyedDecodingContainer where Key: CodingKey {
|
||||||
/// Decodes to a registered molecule based on the identifier
|
/// Decodes to a registered molecule based on the identifier
|
||||||
public func decodeMoleculeIfPresent<T>(codingKey: KeyedDecodingContainer<K>.Key) throws -> T? {
|
public func decodeMoleculeIfPresent<T>(codingKey: KeyedDecodingContainer<K>.Key) throws -> T? {
|
||||||
@ -33,6 +35,15 @@ extension KeyedDecodingContainer where Key: CodingKey {
|
|||||||
}
|
}
|
||||||
return modelT
|
return modelT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Decodes to a registered molecule based on the identifier.
|
||||||
|
public func decodeMolecule<T>(codingKey: KeyedDecodingContainer<K>.Key) throws -> T {
|
||||||
|
guard let model: T = try decodeMoleculeIfPresent(codingKey: codingKey) else {
|
||||||
|
MVMCoreLoggingHandler.logDebugMessage(withDelegate: "ModelRegistry Error decoderErrorObjectNotPresent: \(codingKey.stringValue)")
|
||||||
|
throw ModelRegistry.Error.decoderErrorObjectNotPresent(codingKey: codingKey, codingPath: codingPath)
|
||||||
|
}
|
||||||
|
return model
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public extension MoleculeModelProtocol {
|
public extension MoleculeModelProtocol {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user