From 461a7e4c3f4b9f1b60991736f1ed6988d8526621 Mon Sep 17 00:00:00 2001 From: Jevon Mao Date: Sat, 19 Jun 2021 11:50:05 -0700 Subject: [PATCH 1/3] Add macOS support --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index e760bbc..b9beed0 100644 --- a/Package.swift +++ b/Package.swift @@ -6,7 +6,7 @@ import PackageDescription let package = Package( name: "StepperView", platforms: [ - .iOS(.v11) + .iOS(.v11), .macOS(.v10_15) ], products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. From 967c42c9f3502c7506ddc95eda0943c40cc4f0c8 Mon Sep 17 00:00:00 2001 From: Jevon Mao Date: Sat, 19 Jun 2021 15:35:55 -0700 Subject: [PATCH 2/3] Update podspec --- StepperView.podspec | 1 + 1 file changed, 1 insertion(+) diff --git a/StepperView.podspec b/StepperView.podspec index 73c44cc..aceb0cb 100644 --- a/StepperView.podspec +++ b/StepperView.podspec @@ -19,5 +19,6 @@ Pod::Spec.new do |s| s.social_media_url = 'https://twitter.com/badrivm' s.ios.deployment_target = '11.0' s.watchos.deployment_target = '6.0' + s.macos.deployment_target = '10.15' s.source_files = 'Sources/**/*.swift' end From 70d86fde5ff07ce82924341da6da8ae64f3fe321 Mon Sep 17 00:00:00 2001 From: Jevon Mao Date: Sat, 19 Jun 2021 15:53:43 -0700 Subject: [PATCH 3/3] Adopt example views for cross-platform and macOS --- Example/StepperView/ExampleView11.swift | 8 ++++---- Example/StepperView/ExampleView6.swift | 4 ++-- Example/StepperView/ImageTextRowView.swift | 4 ++-- Example/StepperView/StepperContentView.swift | 4 ++-- .../Views/WatchExampleView3.swift | 2 +- .../Views/WatchExampleView4.swift | 4 ++-- Example/Tests/StepperViewTests.swift | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Example/StepperView/ExampleView11.swift b/Example/StepperView/ExampleView11.swift index 63c21ad..249d115 100644 --- a/Example/StepperView/ExampleView11.swift +++ b/Example/StepperView/ExampleView11.swift @@ -10,7 +10,7 @@ import SwiftUI import UIKit import StepperView -let customGreen = UIColor(red: 0.00, green: 0.80, blue: 0.66, alpha: 1.00) +let customGreen = Color(red: 0.00, green: 0.80, blue: 0.66, alpha: 1.00) @available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *) struct ExampleView11: View { @@ -47,7 +47,7 @@ struct ExampleView11: View { StepperIndicationType.custom(IndicatorImageView(name:"pending")) ]) .stepIndicatorMode(StepperMode.horizontal) - .lineOptions(StepperLineOptions.rounded(4, 8, Color(customGreen))) + .lineOptions(StepperLineOptions.rounded(4, 8, customGreen)) .stepLifeCycles([StepLifeCycle.completed, .completed, .completed, .completed, .completed ]) .spacing(70) .padding(.all, 40) @@ -58,7 +58,7 @@ struct ExampleView11: View { .addSteps(cells) .indicators(indicators) .stepIndicatorMode(StepperMode.horizontal) - .lineOptions(StepperLineOptions.rounded(4, 8, Color(customGreen))) + .lineOptions(StepperLineOptions.rounded(4, 8, customGreen)) .stepLifeCycles([StepLifeCycle.completed, .completed, .pending, .pending]) .spacing(70) .padding(.all, 40) @@ -74,7 +74,7 @@ struct ExampleView11: View { StepperIndicationType.custom(IndicatorImageView(name: "completed")) ]) .stepIndicatorMode(StepperMode.horizontal) - .lineOptions(StepperLineOptions.rounded(4, 8, Color(customGreen))) + .lineOptions(StepperLineOptions.rounded(4, 8, customGreen)) .stepLifeCycles([StepLifeCycle.completed, .completed ]) .spacing(70) .padding(.all, 40) diff --git a/Example/StepperView/ExampleView6.swift b/Example/StepperView/ExampleView6.swift index 73a1835..444550e 100644 --- a/Example/StepperView/ExampleView6.swift +++ b/Example/StepperView/ExampleView6.swift @@ -18,7 +18,7 @@ struct ExampleView6: View { StepperIndicationType.custom(NumberedCircleView(text: "1", width: 40).eraseToAnyView()), StepperIndicationType.custom(CircledIconView(image: Image("like"), width: 40, - strokeColor: Color(UIColor(red: 26/255, green: 188/255, blue: 156/255, alpha: 1.0))) + strokeColor: Color(red: 26/255, green: 188/255, blue: 156/255, alpha: 1.0)) .eraseToAnyView()), StepperIndicationType.custom(CircledIconView(image: Image("flag"), width: 40, @@ -43,7 +43,7 @@ struct ExampleView6: View { let pitStopLines = [ StepperLineOptions.custom(1, Colors.teal.rawValue), - StepperLineOptions.custom(1, Color(UIColor(red: 26/255, green: 188/255, blue: 156/255, alpha: 1.0))), + StepperLineOptions.custom(1, Color(red: 26/255, green: 188/255, blue: 156/255, alpha: 1.0)), StepperLineOptions.custom(1, Color.red), StepperLineOptions.custom(1, Colors.gray(.darkSilver).rawValue) ] diff --git a/Example/StepperView/ImageTextRowView.swift b/Example/StepperView/ImageTextRowView.swift index 00a8cd6..50a264e 100644 --- a/Example/StepperView/ImageTextRowView.swift +++ b/Example/StepperView/ImageTextRowView.swift @@ -35,8 +35,8 @@ struct ImageTextRowView: View { RoundedRectangle(cornerRadius: 8.0) .stroke(Color.gray, lineWidth: 0.5) .foregroundColor(Color.white) - .shadow(color: Color(UIColor.black).opacity(0.03), radius: 8, x: 5, y: -5) - .shadow(color: Color(UIColor.black).opacity(0.03), radius: 8, y: 5)) + .shadow(color: Color(.black).opacity(0.03), radius: 8, x: 5, y: -5) + .shadow(color: Color(.black).opacity(0.03), radius: 8, y: 5)) } } diff --git a/Example/StepperView/StepperContentView.swift b/Example/StepperView/StepperContentView.swift index 01d1b6b..1b7be64 100644 --- a/Example/StepperView/StepperContentView.swift +++ b/Example/StepperView/StepperContentView.swift @@ -21,8 +21,8 @@ struct StepperContentView: View { .overlay(RoundedRectangle(cornerRadius: 8) .frame(width: 300) .foregroundColor(Color.clear) - .shadow(color: Color(UIColor.black).opacity(0.03), radius: 8, x: 5, y: -5) - .shadow(color: Color(UIColor.black).opacity(0.03), radius: 8, y: 5) + .shadow(color: Color(.black).opacity(0.03), radius: 8, x: 5, y: -5) + .shadow(color: Color(.black).opacity(0.03), radius: 8, y: 5) .border(Color.gray)) } diff --git a/Example/StepperView_Watch Extension/Views/WatchExampleView3.swift b/Example/StepperView_Watch Extension/Views/WatchExampleView3.swift index 48aeb23..7d75e7e 100644 --- a/Example/StepperView_Watch Extension/Views/WatchExampleView3.swift +++ b/Example/StepperView_Watch Extension/Views/WatchExampleView3.swift @@ -15,7 +15,7 @@ struct WatchExampleView3: View { let indicators = [ StepperIndicationType.custom(CircledIconView(image: Image("like"), width: 30, - strokeColor: Color(UIColor(red: 26/255, green: 188/255, blue: 156/255, alpha: 1.0))) + strokeColor: Color(red: 26/255, green: 188/255, blue: 156/255, alpha: 1.0)) .eraseToAnyView()), StepperIndicationType.custom(CircledIconView(image: Image("flag"), width: 30, diff --git a/Example/StepperView_Watch Extension/Views/WatchExampleView4.swift b/Example/StepperView_Watch Extension/Views/WatchExampleView4.swift index fed9646..570b4cf 100644 --- a/Example/StepperView_Watch Extension/Views/WatchExampleView4.swift +++ b/Example/StepperView_Watch Extension/Views/WatchExampleView4.swift @@ -15,7 +15,7 @@ struct WatchExampleView4: View { let indicators = [ StepperIndicationType.custom(CircledIconView(image: Image("like"), width: 25, - strokeColor: Color(UIColor(red: 26/255, green: 188/255, blue: 156/255, alpha: 1.0))) + strokeColor: Color(red: 26/255, green: 188/255, blue: 156/255, alpha: 1.0)) .eraseToAnyView()), StepperIndicationType.custom(CircledIconView(image: Image("star"), width: 25, @@ -37,7 +37,7 @@ struct WatchExampleView4: View { ] let pitStopLineOptions = [ - StepperLineOptions.custom(1, Color(UIColor(red: 26/255, green: 188/255, blue: 156/255, alpha: 1.0))), + StepperLineOptions.custom(1, Color(red: 26/255, green: 188/255, blue: 156/255, alpha: 1.0)), StepperLineOptions.custom(1, Colors.red(.normal).rawValue), StepperLineOptions.custom(1, Colors.gray(.light).rawValue)] diff --git a/Example/Tests/StepperViewTests.swift b/Example/Tests/StepperViewTests.swift index 2653e6e..c3da12c 100644 --- a/Example/Tests/StepperViewTests.swift +++ b/Example/Tests/StepperViewTests.swift @@ -138,7 +138,7 @@ class StepperViewTests: XCTestCase { let indicators = [ StepperIndicationType.custom(NumberedCircleView(text: "1", width: 40).eraseToAnyView()), .custom(CircledIconView(image: Image("like"), width: 40, - strokeColor: Color(UIColor(red: 26/255, green: 188/255, blue: 156/255, alpha: 1.0))) + strokeColor: Color(red: 26/255, green: 188/255, blue: 156/255, alpha: 1.0)) .eraseToAnyView()), .custom(CircledIconView(image: Image("flag"), width: 40, strokeColor: Color.red).eraseToAnyView()), @@ -147,7 +147,7 @@ class StepperViewTests: XCTestCase { let pitStopLineOptions = [ StepperLineOptions.custom(1, Colors.teal.rawValue), - StepperLineOptions.custom(1, Color(UIColor(red: 26/255, green: 188/255, blue: 156/255, alpha: 1.0))), + StepperLineOptions.custom(1, Color(red: 26/255, green: 188/255, blue: 156/255, alpha: 1.0)), StepperLineOptions.custom(1, Color.red), StepperLineOptions.custom(1, Colors.gray(.darkSilver).rawValue) ]