change access level
This commit is contained in:
parent
a1f9e4babe
commit
9f574e854b
@ -8,11 +8,11 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public class TabBarModel: MoleculeModelProtocol {
|
open class TabBarModel: MoleculeModelProtocol {
|
||||||
public static var identifier: String = "tabBar"
|
public static var identifier: String = "tabBar"
|
||||||
public var tabs: [TabBarItemModel]
|
open var tabs: [TabBarItemModel]
|
||||||
|
|
||||||
open var _backgroundColor: Color?
|
private var _backgroundColor: Color?
|
||||||
open var backgroundColor: Color? {
|
open var backgroundColor: Color? {
|
||||||
get {
|
get {
|
||||||
if let backgroundColor = _backgroundColor { return backgroundColor }
|
if let backgroundColor = _backgroundColor { return backgroundColor }
|
||||||
@ -25,7 +25,7 @@ public class TabBarModel: MoleculeModelProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open var _selectedColor: Color?
|
private var _selectedColor: Color?
|
||||||
open var selectedColor: Color {
|
open var selectedColor: Color {
|
||||||
get {
|
get {
|
||||||
if let selectedColor = _selectedColor { return selectedColor }
|
if let selectedColor = _selectedColor { return selectedColor }
|
||||||
@ -38,7 +38,7 @@ public class TabBarModel: MoleculeModelProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open var _unSelectedColor: Color?
|
private var _unSelectedColor: Color?
|
||||||
open var unSelectedColor: Color {
|
open var unSelectedColor: Color {
|
||||||
get {
|
get {
|
||||||
if let unselectedColor = _unSelectedColor { return unselectedColor }
|
if let unselectedColor = _unSelectedColor { return unselectedColor }
|
||||||
@ -49,10 +49,10 @@ public class TabBarModel: MoleculeModelProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var style: NavigationItemStyle?
|
open var style: NavigationItemStyle?
|
||||||
|
|
||||||
// Must be capped to 0...(tabs.count - 1)
|
// Must be capped to 0...(tabs.count - 1)
|
||||||
public var selectedTab: Int = 0
|
open var selectedTab: Int = 0
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case moleculeName
|
case moleculeName
|
||||||
@ -88,7 +88,7 @@ public class TabBarModel: MoleculeModelProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
open func encode(to encoder: Encoder) throws {
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
try container.encode(moleculeName, forKey: .moleculeName)
|
try container.encode(moleculeName, forKey: .moleculeName)
|
||||||
try container.encode(tabs, forKey: .tabs)
|
try container.encode(tabs, forKey: .tabs)
|
||||||
@ -100,11 +100,11 @@ public class TabBarModel: MoleculeModelProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TabBarItemModel: Codable {
|
open class TabBarItemModel: Codable {
|
||||||
var title: String?
|
open var title: String?
|
||||||
var image: String
|
open var image: String
|
||||||
var action: ActionModelProtocol
|
open var action: ActionModelProtocol
|
||||||
var accessibilityText: String?
|
open var accessibilityText: String?
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case title
|
case title
|
||||||
@ -127,7 +127,7 @@ public class TabBarItemModel: Codable {
|
|||||||
accessibilityText = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityText)
|
accessibilityText = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityText)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
open func encode(to encoder: Encoder) throws {
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
try container.encodeIfPresent(title, forKey: .title)
|
try container.encodeIfPresent(title, forKey: .title)
|
||||||
try container.encode(image, forKey: .image)
|
try container.encode(image, forKey: .image)
|
||||||
|
|||||||
@ -8,13 +8,13 @@
|
|||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
public class TabsModel: MoleculeModelProtocol {
|
open class TabsModel: MoleculeModelProtocol {
|
||||||
public static var identifier: String = "tabs"
|
public static var identifier: String = "tabs"
|
||||||
public var tabs: [TabItemModel]
|
open var tabs: [TabItemModel]
|
||||||
|
|
||||||
open var style: NavigationItemStyle?
|
open var style: NavigationItemStyle?
|
||||||
|
|
||||||
open var _backgroundColor: Color?
|
private var _backgroundColor: Color?
|
||||||
open var backgroundColor: Color? {
|
open var backgroundColor: Color? {
|
||||||
get {
|
get {
|
||||||
if let backgroundColor = _backgroundColor { return backgroundColor }
|
if let backgroundColor = _backgroundColor { return backgroundColor }
|
||||||
@ -27,7 +27,7 @@ public class TabsModel: MoleculeModelProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open var _selectedColor: Color?
|
private var _selectedColor: Color?
|
||||||
open var selectedColor: Color {
|
open var selectedColor: Color {
|
||||||
get {
|
get {
|
||||||
if let selectedColor = _selectedColor { return selectedColor }
|
if let selectedColor = _selectedColor { return selectedColor }
|
||||||
@ -40,7 +40,7 @@ public class TabsModel: MoleculeModelProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open var _unselectedColor: Color?
|
private var _unselectedColor: Color?
|
||||||
open var unselectedColor: Color {
|
open var unselectedColor: Color {
|
||||||
get {
|
get {
|
||||||
if let unselectedColor = _unselectedColor { return unselectedColor }
|
if let unselectedColor = _unselectedColor { return unselectedColor }
|
||||||
@ -51,7 +51,7 @@ public class TabsModel: MoleculeModelProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open var _selectedBarColor: Color?
|
private var _selectedBarColor: Color?
|
||||||
open var selectedBarColor: Color {
|
open var selectedBarColor: Color {
|
||||||
get {
|
get {
|
||||||
if let selectedBarColor = _selectedBarColor { return selectedBarColor }
|
if let selectedBarColor = _selectedBarColor { return selectedBarColor }
|
||||||
@ -65,7 +65,7 @@ public class TabsModel: MoleculeModelProtocol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Must be capped to 0...(tabs.count - 1)
|
// Must be capped to 0...(tabs.count - 1)
|
||||||
public var selectedIndex: Int = 0
|
open var selectedIndex: Int = 0
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case moleculeName
|
case moleculeName
|
||||||
@ -97,7 +97,7 @@ public class TabsModel: MoleculeModelProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
open func encode(to encoder: Encoder) throws {
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
try container.encode(moleculeName, forKey: .moleculeName)
|
try container.encode(moleculeName, forKey: .moleculeName)
|
||||||
try container.encode(tabs, forKey: .tabs)
|
try container.encode(tabs, forKey: .tabs)
|
||||||
@ -112,11 +112,11 @@ public class TabsModel: MoleculeModelProtocol {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class TabItemModel: Codable {
|
open class TabItemModel: Codable {
|
||||||
public var label: LabelModel
|
open var label: LabelModel
|
||||||
public var action: ActionModelProtocol?
|
open var action: ActionModelProtocol?
|
||||||
|
|
||||||
init(label: LabelModel) {
|
public init(label: LabelModel) {
|
||||||
self.label = label
|
self.label = label
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ public class TabItemModel: Codable {
|
|||||||
case action
|
case action
|
||||||
}
|
}
|
||||||
|
|
||||||
func setDefaults() {
|
open func setDefaults() {
|
||||||
if label.textAlignment == nil {
|
if label.textAlignment == nil {
|
||||||
label.textAlignment = .center
|
label.textAlignment = .center
|
||||||
}
|
}
|
||||||
@ -144,7 +144,7 @@ public class TabItemModel: Codable {
|
|||||||
setDefaults()
|
setDefaults()
|
||||||
}
|
}
|
||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
open func encode(to encoder: Encoder) throws {
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
try container.encodeModel(label, forKey: .label)
|
try container.encodeModel(label, forKey: .label)
|
||||||
try container.encodeModelIfPresent(action, forKey: .action)
|
try container.encodeModelIfPresent(action, forKey: .action)
|
||||||
|
|||||||
@ -26,7 +26,7 @@ open class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProtoc
|
|||||||
open var hidesSystemBackButton = true
|
open var hidesSystemBackButton = true
|
||||||
open var style: NavigationItemStyle?
|
open var style: NavigationItemStyle?
|
||||||
|
|
||||||
open var _backgroundColor: Color?
|
private var _backgroundColor: Color?
|
||||||
open var backgroundColor: Color? {
|
open var backgroundColor: Color? {
|
||||||
get {
|
get {
|
||||||
if let backgroundColor = _backgroundColor { return backgroundColor }
|
if let backgroundColor = _backgroundColor { return backgroundColor }
|
||||||
@ -39,7 +39,7 @@ open class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProtoc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open var _tintColor: Color?
|
private var _tintColor: Color?
|
||||||
open var tintColor: Color {
|
open var tintColor: Color {
|
||||||
get {
|
get {
|
||||||
if let tintColor = _tintColor { return tintColor }
|
if let tintColor = _tintColor { return tintColor }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user