move custom environment key and values to PagerTabStripView.swift

This commit is contained in:
Martin Barreto 2021-07-27 22:36:23 -03:00
parent e13452ad1b
commit d3e9e367de
2 changed files with 11 additions and 14 deletions

View File

@ -21,17 +21,3 @@ extension View {
}
}
private struct CustomStyleKey: EnvironmentKey {
static let defaultValue = PagerTabViewStyle()
}
extension EnvironmentValues {
var customStyleValue: PagerTabViewStyle {
get { self[CustomStyleKey.self] }
set { self[CustomStyleKey.self] = newValue }
}
}
//extension EnvironmentValues {
// static let customStyle: Bool = false
//}

View File

@ -20,6 +20,17 @@ public struct PagerTabViewStyle {
}
}
private struct CustomStyleKey: EnvironmentKey {
static let defaultValue = PagerTabViewStyle()
}
extension EnvironmentValues {
var customStyleValue: PagerTabViewStyle {
get { self[CustomStyleKey.self] }
set { self[CustomStyleKey.self] = newValue }
}
}
public class PagerSettings: ObservableObject {
@Published var width: CGFloat = 0
@Published var contentOffset: CGFloat = 0