Skip to content

Commit

Permalink
beta 5 compatibility fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
QuynhNguyen committed Aug 3, 2019
1 parent ab41045 commit b0f0662
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Sources/SlidingTabView/SlidingTabView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,28 +68,28 @@ public struct SlidingTabView : View {
let activeTabColor: Color

/// The height of the selection bar
let selectionBarHeight: Length
let selectionBarHeight: CGFloat

/// The selection bar background color
let selectionBarBackgroundColor: Color

/// The height of the selection bar background
let selectionBarBackgroundHeight: Length
let selectionBarBackgroundHeight: CGFloat

// MARK: init

public init(selection: Binding<Int>,
tabs: [String],
font: Font = .body,
animation: Animation = .spring(damping: 12),
animation: Animation = .spring(),
activeAccentColor: Color = .blue,
inactiveAccentColor: Color = Color.black.opacity(0.4),
selectionBarColor: Color = .blue,
inactiveTabColor: Color = .clear,
activeTabColor: Color = .clear,
selectionBarHeight: Length = 2,
selectionBarHeight: CGFloat = 2,
selectionBarBackgroundColor: Color = Color.gray.opacity(0.2),
selectionBarBackgroundHeight: Length = 1) {
selectionBarBackgroundHeight: CGFloat = 1) {
self._selection = selection
self.tabs = tabs
self.font = font
Expand All @@ -111,7 +111,7 @@ public struct SlidingTabView : View {

return VStack(alignment: .leading, spacing: 0) {
HStack(spacing: 0) {
ForEach(self.tabs.identified(by: \.self)) { tab in
ForEach(self.tabs, id:\.self) { tab in
Button(action: {
let selection = self.tabs.firstIndex(of: tab) ?? 0
self.selectionState = selection
Expand Down

1 comment on commit b0f0662

@mohammadkarbalaee
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such a decent library. Thank you so much.

Please sign in to comment.