Skip to content

Commit

Permalink
refactor: modify path
Browse files Browse the repository at this point in the history
  • Loading branch information
DalioKim committed Aug 2, 2023
1 parent 7cc21cb commit 9d674bf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import PackageDescription

let package = Package(
name: "ReadyDrivenUI",
platforms: [
.iOS(.v14),
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

import SwiftUI

import SwiftUI

struct AutoSliderModifier: ViewModifier {
var delayTime: TimeInterval
@Binding var selection: Int
Expand All @@ -26,6 +24,7 @@ struct AutoSliderModifier: ViewModifier {
}
}

@available(macOS 11.0, *)
extension TabView {
func addAutoSliderAction(delayTime: TimeInterval, selection: Binding<Int>, itemCount: Int) -> some View {
modifier(AutoSliderModifier(delayTime: delayTime, selection: selection, itemCount: itemCount))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public struct BaseBannerView: View {
let timer = Timer.publish(every: 1, on: .main, in: .common).autoconnect()

public var body: some View {
ZStack {
TabView(selection : $selection) {
ForEach(tabItems) { item in
Image(item.image)
Expand All @@ -38,7 +37,6 @@ public struct BaseBannerView: View {
.if(displayMode.isAutoSlide) {
$0.addAutoSliderAction(delayTime: 1, selection: $selection, itemCount: images.count)
}
}
}
}

Expand All @@ -60,10 +58,12 @@ extension BaseBannerView {
}
}


@available(macOS 10.15, *)
extension BaseBannerView {
private var tabItems: [TabItem] {
images.enumerated().map { idx, item in
TabItem(icon: item, tag: idx)
TabItem(image: item, tag: idx)
}
}
}
File renamed without changes.

0 comments on commit 9d674bf

Please sign in to comment.