From d55ff5e761b131ac81dd6b82a45af55f0e6de26e Mon Sep 17 00:00:00 2001 From: Andrew Roan Date: Tue, 25 Apr 2023 00:35:43 -0500 Subject: [PATCH 1/4] Update workflow matrix to include macos-13 and xcode-14.x. Breakout linting into separate job. feature/update-workflow --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 30 -------------------------- 2 files changed, 44 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8f4db7a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - '*' + workflow_dispatch: + +jobs: + lint: + runs-on: macos-13 + environment: default + steps: + - uses: actions/checkout@v3 + - name: Format lint + run: swiftformat --lint . + - name: Lint + run: swiftlint . + ui-tests: + strategy: + matrix: + include: + - os: macos-12 + xcode: 13.2.1 # Swift 5.5.2 + sim: iPhone 13 + - os: macos-12 + xcode: 13.4.1 # Swift 5.6 + sim: iPhone 13 + - os: macos-13 + xcode: 14.2 # Swift 5.7 + sim: iPhone 14 + - os: macos-13 + xcode: 14.3 # Swift 5.8 + sim: iPhone 14 + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Select Xcode ${{ matrix.xcode }} + run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app + - name: Run tests + run: xcodebuild -project ./Example/Example.xcodeproj -scheme Example test -destination platform='iOS Simulator',name='${{ matrix.sim }}' -quiet -enableCodeCoverage YES -derivedDataPath "./output" \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index ca9f0cd..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Test - -on: - push: - branches: - - main - pull_request: - branches: - - '*' - workflow_dispatch: - -jobs: - example: - runs-on: macos-12 - strategy: - matrix: - xcode: - - "13.2.1" - - "13.4.1" - - "14.0" - steps: - - uses: actions/checkout@v2 - - name: Select Xcode ${{ matrix.xcode }} - run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app - - name: Format lint - run: swiftformat --lint . - - name: Lint - run: swiftlint . - - name: Run tests - run: xcodebuild -project ./Example/Example.xcodeproj -scheme Example test -destination platform='iOS Simulator',name='iPhone 11' -quiet -enableCodeCoverage YES -derivedDataPath "./output" \ No newline at end of file From 2aaebc6d2142f6be64441ccdb58885daccc81bfc Mon Sep 17 00:00:00 2001 From: Andrew Roan Date: Tue, 25 Apr 2023 00:46:50 -0500 Subject: [PATCH 2/4] Run swiftformat. Resolve lint warnings. feature/update-workflow --- .swiftlint.yml | 1 + Example/Example/ExampleApp.swift | 2 +- .../ExampleUITests/ExampleUITestCase.swift | 2 +- .../ExampleUITests/MutliValueUITests.swift | 4 +-- .../SingleOptionalValueTests.swift | 4 +-- .../ExampleUITests/SingleValueUITests.swift | 14 +++++----- .../ExampleUITests/XCUIElement+Trigger.swift | 2 +- .../XCUIElementQuery+ExactlyOneMatching.swift | 2 +- Example/ExampleUITests/XCUITestCase.swift | 2 +- .../Shared/BackPortedButtonToggleStyle.swift | 2 +- .../Shared/Sources/Shared/ContentView.swift | 2 +- .../Shared/GridBetterPickerStyle.swift | 2 +- Example/Shared/Sources/Shared/Item.swift | 2 +- Example/Shared/Sources/Shared/ItemLabel.swift | 2 +- Example/Shared/Sources/Shared/LazyView.swift | 2 +- .../Sources/Shared/MultiValueSelection.swift | 2 +- Example/Shared/Sources/Shared/RouteView.swift | 2 +- .../Shared/SingleOptionalValueSelection.swift | 4 +-- .../Sources/Shared/SingleValueSelection.swift | 2 +- Example/Shared/Sources/Shared/TabOption.swift | 2 +- Sources/PickBetter/BetterPicker.swift | 26 +++++++++---------- .../PickBetter/BetterPickerSelection.swift | 2 +- Sources/PickBetter/BetterPickerStyle.swift | 2 +- .../BetterPickerStyleCellConfiguration.swift | 2 +- .../BetterPickerStyleConfiguration.swift | 2 +- Sources/PickBetter/Internal/CellWrapper.swift | 2 +- .../PlainInlineBetterPickerStyle.swift | 4 +-- Sources/PickBetter/StyleBuilder.swift | 4 +-- 28 files changed, 51 insertions(+), 50 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index a432951..e6d4f44 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -20,6 +20,7 @@ identifier_name: - _max - or - by + - up type_name: allowed_symbols: "_" excluded: diff --git a/Example/Example/ExampleApp.swift b/Example/Example/ExampleApp.swift index 3aae123..35d6f28 100644 --- a/Example/Example/ExampleApp.swift +++ b/Example/Example/ExampleApp.swift @@ -1,7 +1,7 @@ // ExampleApp.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Example/ExampleUITests/ExampleUITestCase.swift b/Example/ExampleUITests/ExampleUITestCase.swift index 0ff1549..6701072 100644 --- a/Example/ExampleUITests/ExampleUITestCase.swift +++ b/Example/ExampleUITests/ExampleUITestCase.swift @@ -1,7 +1,7 @@ // ExampleUITestCase.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Example/ExampleUITests/MutliValueUITests.swift b/Example/ExampleUITests/MutliValueUITests.swift index 480fdda..75e5559 100644 --- a/Example/ExampleUITests/MutliValueUITests.swift +++ b/Example/ExampleUITests/MutliValueUITests.swift @@ -1,7 +1,7 @@ // MutliValueUITests.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. @@ -35,7 +35,7 @@ final class MultiValueUITests: ExampleUITestCase { XCTAssert(try buttonZero().exists, "Button Zero must exist") XCTAssert(try buttonOne().exists, "Button One must exist") XCTAssert( - try !buttonZero().isSelected && (try !buttonOne().isSelected), + try !buttonZero().isSelected && (!buttonOne().isSelected), "Initial state should have no item selected" ) diff --git a/Example/ExampleUITests/SingleOptionalValueTests.swift b/Example/ExampleUITests/SingleOptionalValueTests.swift index 9418347..67ec387 100644 --- a/Example/ExampleUITests/SingleOptionalValueTests.swift +++ b/Example/ExampleUITests/SingleOptionalValueTests.swift @@ -1,7 +1,7 @@ // SingleOptionalValueTests.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. @@ -37,7 +37,7 @@ final class SingleOptionalValueUITests: ExampleUITestCase { XCTAssert(try buttonZero().exists, "Button Zero must exist") XCTAssert(try buttonOne().exists, "Button One must exist") XCTAssert( - try !buttonZero().isSelected && (try !buttonOne().isSelected), + try !buttonZero().isSelected && (!buttonOne().isSelected), "Initial state should have no item selected" ) diff --git a/Example/ExampleUITests/SingleValueUITests.swift b/Example/ExampleUITests/SingleValueUITests.swift index 459c8fd..66b2faa 100644 --- a/Example/ExampleUITests/SingleValueUITests.swift +++ b/Example/ExampleUITests/SingleValueUITests.swift @@ -1,7 +1,7 @@ // SingleValueUITests.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. @@ -26,7 +26,7 @@ final class SingleValueUITests: ExampleUITestCase { _ = try sectionNavItem().waitForExistence(timeout: 1) XCTAssert(try sectionNavItem().exists, "Navigation link/tab for 'Single' value picker must exist") #if os(tvOS) - guard try findVertically(try sectionNavItem(), method: .upOnly) else { + guard try findVertically(sectionNavItem(), method: .upOnly) else { XCTFail("Failed to find navigation picker") return } @@ -42,11 +42,11 @@ final class SingleValueUITests: ExampleUITestCase { XCTAssert(try buttonZero().isSelected, "Initial state should have the first item selected which is '0'") #if os(tvOS) - guard try findVertically(try button(3), method: .downOnly) else { + guard try findVertically(button(3), method: .downOnly) else { XCTFail("Failed to find '3' to select it.") return } - guard try findHorizontally(try buttonZero(), method: .leftOnly) else { + guard try findHorizontally(buttonZero(), method: .leftOnly) else { XCTFail("Failed to find '0'") return } @@ -56,7 +56,7 @@ final class SingleValueUITests: ExampleUITestCase { XCTAssert(try !buttonOne().isSelected, "'1' should not be selected before being tapped.") #if os(tvOS) - guard try findHorizontally(try buttonOne(), method: .rightOnly) else { + guard try findHorizontally(buttonOne(), method: .rightOnly) else { XCTFail("Failed to find '1' to select it.") return } @@ -70,7 +70,7 @@ final class SingleValueUITests: ExampleUITestCase { func testGridStyleDeselectAndSelectNew() throws { _ = try gridStyleToggle().waitForExistence(timeout: 1) #if os(tvOS) - guard try findVertically(try gridStyleToggle(), method: .downOnly) else { + guard try findVertically(gridStyleToggle(), method: .downOnly) else { XCTFail("Failed to find grid toggle") return } @@ -83,7 +83,7 @@ final class SingleValueUITests: ExampleUITestCase { func testListStyleDeselectAndSelectNew() throws { _ = try gridStyleToggle().waitForExistence(timeout: 1) #if os(tvOS) - guard try findVertically(try gridStyleToggle(), method: .downOnly) else { + guard try findVertically(gridStyleToggle(), method: .downOnly) else { XCTFail("Failed to find grid toggle") return } diff --git a/Example/ExampleUITests/XCUIElement+Trigger.swift b/Example/ExampleUITests/XCUIElement+Trigger.swift index 748debb..f9d0c7e 100644 --- a/Example/ExampleUITests/XCUIElement+Trigger.swift +++ b/Example/ExampleUITests/XCUIElement+Trigger.swift @@ -1,7 +1,7 @@ // XCUIElement+Trigger.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Example/ExampleUITests/XCUIElementQuery+ExactlyOneMatching.swift b/Example/ExampleUITests/XCUIElementQuery+ExactlyOneMatching.swift index 65aa1cf..6fe1345 100644 --- a/Example/ExampleUITests/XCUIElementQuery+ExactlyOneMatching.swift +++ b/Example/ExampleUITests/XCUIElementQuery+ExactlyOneMatching.swift @@ -1,7 +1,7 @@ // XCUIElementQuery+ExactlyOneMatching.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Example/ExampleUITests/XCUITestCase.swift b/Example/ExampleUITests/XCUITestCase.swift index 938fc1a..dc072fc 100644 --- a/Example/ExampleUITests/XCUITestCase.swift +++ b/Example/ExampleUITests/XCUITestCase.swift @@ -1,7 +1,7 @@ // XCUITestCase.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Example/Shared/Sources/Shared/BackPortedButtonToggleStyle.swift b/Example/Shared/Sources/Shared/BackPortedButtonToggleStyle.swift index 258b6eb..a855f15 100644 --- a/Example/Shared/Sources/Shared/BackPortedButtonToggleStyle.swift +++ b/Example/Shared/Sources/Shared/BackPortedButtonToggleStyle.swift @@ -1,7 +1,7 @@ // BackPortedButtonToggleStyle.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Example/Shared/Sources/Shared/ContentView.swift b/Example/Shared/Sources/Shared/ContentView.swift index 789ee73..a427e56 100644 --- a/Example/Shared/Sources/Shared/ContentView.swift +++ b/Example/Shared/Sources/Shared/ContentView.swift @@ -1,7 +1,7 @@ // ContentView.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Example/Shared/Sources/Shared/GridBetterPickerStyle.swift b/Example/Shared/Sources/Shared/GridBetterPickerStyle.swift index 0e9e0ca..50899cc 100644 --- a/Example/Shared/Sources/Shared/GridBetterPickerStyle.swift +++ b/Example/Shared/Sources/Shared/GridBetterPickerStyle.swift @@ -1,7 +1,7 @@ // GridBetterPickerStyle.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Example/Shared/Sources/Shared/Item.swift b/Example/Shared/Sources/Shared/Item.swift index e3af3e3..babe0e2 100644 --- a/Example/Shared/Sources/Shared/Item.swift +++ b/Example/Shared/Sources/Shared/Item.swift @@ -1,7 +1,7 @@ // Item.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Example/Shared/Sources/Shared/ItemLabel.swift b/Example/Shared/Sources/Shared/ItemLabel.swift index 8600cc5..99386d2 100644 --- a/Example/Shared/Sources/Shared/ItemLabel.swift +++ b/Example/Shared/Sources/Shared/ItemLabel.swift @@ -1,7 +1,7 @@ // ItemLabel.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Example/Shared/Sources/Shared/LazyView.swift b/Example/Shared/Sources/Shared/LazyView.swift index 42a6774..c9ec1f3 100644 --- a/Example/Shared/Sources/Shared/LazyView.swift +++ b/Example/Shared/Sources/Shared/LazyView.swift @@ -1,7 +1,7 @@ // LazyView.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Example/Shared/Sources/Shared/MultiValueSelection.swift b/Example/Shared/Sources/Shared/MultiValueSelection.swift index 6423a93..4b32909 100644 --- a/Example/Shared/Sources/Shared/MultiValueSelection.swift +++ b/Example/Shared/Sources/Shared/MultiValueSelection.swift @@ -1,7 +1,7 @@ // MultiValueSelection.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Example/Shared/Sources/Shared/RouteView.swift b/Example/Shared/Sources/Shared/RouteView.swift index 649237c..cd662d2 100644 --- a/Example/Shared/Sources/Shared/RouteView.swift +++ b/Example/Shared/Sources/Shared/RouteView.swift @@ -1,7 +1,7 @@ // RouteView.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Example/Shared/Sources/Shared/SingleOptionalValueSelection.swift b/Example/Shared/Sources/Shared/SingleOptionalValueSelection.swift index b0f5b09..4996318 100644 --- a/Example/Shared/Sources/Shared/SingleOptionalValueSelection.swift +++ b/Example/Shared/Sources/Shared/SingleOptionalValueSelection.swift @@ -1,7 +1,7 @@ // SingleOptionalValueSelection.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. @@ -14,7 +14,7 @@ import SwiftUI public struct SingleOptionalValueSelection: View { private let items: [Item] private let isGridStyle: Bool - @State private var selection: Item.ID? = nil + @State private var selection: Item.ID? public init(items: [Item], isGridStyle: Bool) { self.items = items diff --git a/Example/Shared/Sources/Shared/SingleValueSelection.swift b/Example/Shared/Sources/Shared/SingleValueSelection.swift index c368a84..2dc8df9 100644 --- a/Example/Shared/Sources/Shared/SingleValueSelection.swift +++ b/Example/Shared/Sources/Shared/SingleValueSelection.swift @@ -1,7 +1,7 @@ // SingleValueSelection.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Example/Shared/Sources/Shared/TabOption.swift b/Example/Shared/Sources/Shared/TabOption.swift index ebfeecd..8cab29a 100644 --- a/Example/Shared/Sources/Shared/TabOption.swift +++ b/Example/Shared/Sources/Shared/TabOption.swift @@ -1,7 +1,7 @@ // TabOption.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Sources/PickBetter/BetterPicker.swift b/Sources/PickBetter/BetterPicker.swift index 6d06059..fb24e1a 100644 --- a/Sources/PickBetter/BetterPicker.swift +++ b/Sources/PickBetter/BetterPicker.swift @@ -1,7 +1,7 @@ // BetterPicker.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. @@ -24,7 +24,7 @@ public struct BetterPicker: View where SelectionBox: @Binding private var selection: SelectionBox public var body: some View { - self.betterPickerStyle(PlainInlineBetterPickerStyle()) + betterPickerStyle(PlainInlineBetterPickerStyle()) } /// Accessor function used by styles to build the view @@ -102,12 +102,12 @@ public struct BetterPicker: View where SelectionBox: /// - selectionValue: `@escaping (Data.Element) -> SelectionValue` /// - selection: `Binding` /// - content: `(Data.Element) -> ItemContent` -- View builder for a cell - public init( + public init( _ data: Data, selectionValue: @escaping (Data.Element) -> SelectionValue, - selection: Binding, + selection: Binding, @ViewBuilder content: @MainActor @escaping (Data.Element) -> ItemContent - ) where Data: Sequence, SelectionBox == WrappedSelectionValue? { + ) where Data: Sequence, SelectionBox == Selection? { self.init( items: Self.itemsFromData(data, selectionValue: selectionValue, content: content), selection: selection @@ -165,12 +165,12 @@ extension BetterPicker { /// - data: Data -- `Sequence` where `Data.Element == SelectionValue` /// - selection: `Binding` /// - content: `(Data.Element) -> ItemContent` -- View builder for a cell - public init( + public init( _ data: Data, - selection: Binding, + selection: Binding, @ViewBuilder content: @MainActor @escaping (Data.Element) -> ItemContent - ) where Data: Sequence, Data.Element == WrappedSelectionValue, - SelectionBox == WrappedSelectionValue? + ) where Data: Sequence, Data.Element == Selection, + SelectionBox == Selection? { self.init( items: Self.itemsFromData(data, selectionValue: { $0 }, content: content), @@ -224,12 +224,12 @@ extension BetterPicker { /// - data: Data -- `Sequence` where `Data.Element: Identifiable`, `Data.Element.ID == SelectionValue` /// - selection: `Binding` /// - content: `(Data.Element) -> ItemContent` -- View builder for a cell - public init( + public init( _ data: Data, - selection: Binding, + selection: Binding, @ViewBuilder content: @MainActor @escaping (Data.Element) -> ItemContent - ) where Data: Sequence, Data.Element: Identifiable, Data.Element.ID == WrappedSelectionValue, - SelectionBox == WrappedSelectionValue? + ) where Data: Sequence, Data.Element: Identifiable, Data.Element.ID == Selection, + SelectionBox == Selection? { self.init( items: Self.itemsFromData(data, selectionValue: \.id, content: content), diff --git a/Sources/PickBetter/BetterPickerSelection.swift b/Sources/PickBetter/BetterPickerSelection.swift index c463486..6f89423 100644 --- a/Sources/PickBetter/BetterPickerSelection.swift +++ b/Sources/PickBetter/BetterPickerSelection.swift @@ -1,7 +1,7 @@ // BetterPickerSelection.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Sources/PickBetter/BetterPickerStyle.swift b/Sources/PickBetter/BetterPickerStyle.swift index 67f6db1..a5a7cfa 100644 --- a/Sources/PickBetter/BetterPickerStyle.swift +++ b/Sources/PickBetter/BetterPickerStyle.swift @@ -1,7 +1,7 @@ // BetterPickerStyle.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Sources/PickBetter/BetterPickerStyleCellConfiguration.swift b/Sources/PickBetter/BetterPickerStyleCellConfiguration.swift index 169ac09..6f2ff34 100644 --- a/Sources/PickBetter/BetterPickerStyleCellConfiguration.swift +++ b/Sources/PickBetter/BetterPickerStyleCellConfiguration.swift @@ -1,7 +1,7 @@ // BetterPickerStyleCellConfiguration.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Sources/PickBetter/BetterPickerStyleConfiguration.swift b/Sources/PickBetter/BetterPickerStyleConfiguration.swift index 80e954c..d4569fc 100644 --- a/Sources/PickBetter/BetterPickerStyleConfiguration.swift +++ b/Sources/PickBetter/BetterPickerStyleConfiguration.swift @@ -1,7 +1,7 @@ // BetterPickerStyleConfiguration.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Sources/PickBetter/Internal/CellWrapper.swift b/Sources/PickBetter/Internal/CellWrapper.swift index 053fe0a..707b39f 100644 --- a/Sources/PickBetter/Internal/CellWrapper.swift +++ b/Sources/PickBetter/Internal/CellWrapper.swift @@ -1,7 +1,7 @@ // CellWrapper.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. diff --git a/Sources/PickBetter/PlainInlineBetterPickerStyle.swift b/Sources/PickBetter/PlainInlineBetterPickerStyle.swift index ecb12ff..bcfdaaf 100644 --- a/Sources/PickBetter/PlainInlineBetterPickerStyle.swift +++ b/Sources/PickBetter/PlainInlineBetterPickerStyle.swift @@ -1,7 +1,7 @@ // PlainInlineBetterPickerStyle.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. @@ -60,7 +60,7 @@ public struct PlainInlineBetterPickerStyle: BetterPickerStyle { @MainActor private struct OptionalSelectionPreview: View { - @State private var selection: PreviewItem.ID? = nil + @State private var selection: PreviewItem.ID? var body: some View { VStack { diff --git a/Sources/PickBetter/StyleBuilder.swift b/Sources/PickBetter/StyleBuilder.swift index 16cd57a..f23b2b8 100644 --- a/Sources/PickBetter/StyleBuilder.swift +++ b/Sources/PickBetter/StyleBuilder.swift @@ -1,7 +1,7 @@ // StyleBuilder.swift // PickBetter // -// Copyright © 2022 MFB Technologies, Inc. All rights reserved. All rights reserved. +// Copyright © 2023 MFB Technologies, Inc. All rights reserved. All rights reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. @@ -10,7 +10,7 @@ import Foundation import SwiftUI /// `resultBuilder` implementation for `BetterPickerStyle` that enables convenient choosing of a style in logic without -// causing problems with different types. +/// causing problems with different types. @resultBuilder public enum StyleBuilder { public static func buildBlock(_ style: Style) -> Style { From e7e8d10e37849604d6bd0e595809c7120eb940ff Mon Sep 17 00:00:00 2001 From: Andrew Roan Date: Tue, 25 Apr 2023 00:47:38 -0500 Subject: [PATCH 3/4] Clean up signing in example project feature/update-workflow --- Example/Example.xcodeproj/project.pbxproj | 46 ++++++++++++------- .../xcschemes/Example-macOS.xcscheme | 2 +- .../xcshareddata/xcschemes/Example.xcscheme | 2 +- 3 files changed, 31 insertions(+), 19 deletions(-) diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index b63e98b..24e161d 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -293,7 +293,7 @@ attributes = { BuildIndependentTargetsInParallel = 1; LastSwiftUpdateCheck = 1330; - LastUpgradeCheck = 1330; + LastUpgradeCheck = 1430; TargetAttributes = { 49A241B22800EBBC003DD15F = { CreatedOnToolsVersion = 13.3; @@ -425,11 +425,12 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = "Example-macOS/Example_macOS.entitlements"; CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"Example-macOS/Preview Content\""; - DEVELOPMENT_TEAM = D79J55YKW6; + DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -442,6 +443,7 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = "com.mfbtech.picker-better.Example-macOS"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_STRICT_CONCURRENCY = complete; @@ -456,11 +458,12 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = "Example-macOS/Example_macOS.entitlements"; CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"Example-macOS/Preview Content\""; - DEVELOPMENT_TEAM = D79J55YKW6; + DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -473,6 +476,7 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = "com.mfbtech.picker-better.Example-macOS"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_STRICT_CONCURRENCY = complete; @@ -485,10 +489,10 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"Example-tvOS/Preview Content\""; - DEVELOPMENT_TEAM = D79J55YKW6; + DEVELOPMENT_TEAM = ""; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; @@ -500,6 +504,7 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = "com.mfbtech.picker-better.Example-tvOS"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = appletvos; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_STRICT_CONCURRENCY = complete; @@ -514,10 +519,10 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"Example-tvOS/Preview Content\""; - DEVELOPMENT_TEAM = D79J55YKW6; + DEVELOPMENT_TEAM = ""; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; @@ -529,6 +534,7 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = "com.mfbtech.picker-better.Example-tvOS"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = appletvos; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_STRICT_CONCURRENCY = complete; @@ -660,10 +666,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = Example/Example.entitlements; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"Example/Preview Content\""; - DEVELOPMENT_TEAM = D79J55YKW6; + DEVELOPMENT_TEAM = ""; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; @@ -681,6 +687,7 @@ PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.pick-better.Example"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_STRICT_CONCURRENCY = complete; @@ -697,10 +704,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = Example/Example.entitlements; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"Example/Preview Content\""; - DEVELOPMENT_TEAM = D79J55YKW6; + DEVELOPMENT_TEAM = ""; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; @@ -718,6 +725,7 @@ PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.pick-better.Example"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_STRICT_CONCURRENCY = complete; @@ -732,13 +740,15 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CODE_SIGN_STYLE = Automatic; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = D79J55YKW6; + DEVELOPMENT_TEAM = ""; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = "com.pick-better.ExampleUITests"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_STRICT_CONCURRENCY = complete; SWIFT_VERSION = 5.0; @@ -751,13 +761,15 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CODE_SIGN_STYLE = Automatic; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = D79J55YKW6; + DEVELOPMENT_TEAM = ""; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = "com.pick-better.ExampleUITests"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_STRICT_CONCURRENCY = complete; SWIFT_VERSION = 5.0; diff --git a/Example/Example.xcodeproj/xcshareddata/xcschemes/Example-macOS.xcscheme b/Example/Example.xcodeproj/xcshareddata/xcschemes/Example-macOS.xcscheme index 2f94a1d..eea0f19 100644 --- a/Example/Example.xcodeproj/xcshareddata/xcschemes/Example-macOS.xcscheme +++ b/Example/Example.xcodeproj/xcshareddata/xcschemes/Example-macOS.xcscheme @@ -1,6 +1,6 @@ Date: Tue, 25 Apr 2023 01:08:29 -0500 Subject: [PATCH 4/4] Update checkout action to version 3 feature/update-workflow --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f4db7a..b60f973 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: sim: iPhone 14 runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Select Xcode ${{ matrix.xcode }} run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app - name: Run tests