Skip to content

Commit

Permalink
Merge pull request #8 from AlfredoHernandez/feature/os-update
Browse files Browse the repository at this point in the history
Package platforms update
  • Loading branch information
AlfredoHernandez committed Jul 12, 2023
2 parents 77a89cc + 1e6afa3 commit 2898907
Show file tree
Hide file tree
Showing 26 changed files with 199 additions and 63 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflow will build a Swift project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift

name: Swift

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: macos-13

steps:
- uses: actions/checkout@v3

- name: Select Xcode Version
run: sudo xcode-select -switch /Applications/Xcode_14.3.1.app

- name: Build
run: swift build -vv

- name: Run tests
run: swift test list --parallel -vv
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.3
5.8
33 changes: 33 additions & 0 deletions .swiftpm/WhatsNew.xctestplan
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"configurations" : [
{
"id" : "F17011D2-13DA-4700-B107-AD87D2D0EBBC",
"name" : "Test Scheme Action",
"options" : {

}
}
],
"defaultOptions" : {
"codeCoverage" : {
"targets" : [
{
"containerPath" : "container:",
"identifier" : "WhatsNew",
"name" : "WhatsNew"
}
]
},
"testExecutionOrdering" : "random"
},
"testTargets" : [
{
"target" : {
"containerPath" : "container:",
"identifier" : "WhatsNewTests",
"name" : "WhatsNewTests"
}
}
],
"version" : 1
}
97 changes: 97 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/WhatsNew.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "WhatsNew"
BuildableName = "WhatsNew"
BlueprintName = "WhatsNew"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "WhatsNewTests"
BuildableName = "WhatsNewTests"
BlueprintName = "WhatsNewTests"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:.swiftpm/WhatsNew.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "WhatsNewTests"
BuildableName = "WhatsNewTests"
BlueprintName = "WhatsNewTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "WhatsNew"
BuildableName = "WhatsNew"
BlueprintName = "WhatsNew"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
18 changes: 6 additions & 12 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
// swift-tools-version: 5.6
// The swift-tools-version declares the minimum version of Swift required to build this package.
// swift-tools-version: 5.8

import PackageDescription

let package = Package(
name: "WhatsNew",
defaultLocalization: "en",
platforms: [
.iOS(.v13),
.iOS(.v14),
.macOS(.v12),
],
products: [
.library(
name: "WhatsNew",
targets: ["WhatsNew"]),
.library(name: "WhatsNew", targets: ["WhatsNew"]),
],
dependencies: [],
targets: [
.target(
name: "WhatsNew",
dependencies: []),
.testTarget(
name: "WhatsNewTests",
dependencies: ["WhatsNew"]),
.target(name: "WhatsNew", dependencies: []),
.testTarget(name: "WhatsNewTests", dependencies: ["WhatsNew"]),
]
)
2 changes: 1 addition & 1 deletion Sources/WhatsNew/Check Version Feature/AppVersion.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2022 Jesús Alfredo Hernández Alarcón. All rights reserved.
// Copyright © 2023 Jesús Alfredo Hernández Alarcón. All rights reserved.
//

import Foundation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2022 Jesús Alfredo Hernández Alarcón. All rights reserved.
// Copyright © 2023 Jesús Alfredo Hernández Alarcón. All rights reserved.
//

import Foundation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2022 Jesús Alfredo Hernández Alarcón. All rights reserved.
// Copyright © 2023 Jesús Alfredo Hernández Alarcón. All rights reserved.
//

import Foundation
Expand Down
2 changes: 1 addition & 1 deletion Sources/WhatsNew/Check Version Feature/String+Semver.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2022 Jesús Alfredo Hernández Alarcón. All rights reserved.
// Copyright © 2023 Jesús Alfredo Hernández Alarcón. All rights reserved.
//

import Foundation
Expand Down
2 changes: 1 addition & 1 deletion Sources/WhatsNew/Check Version Feature/WhatsNewStore.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2022 Jesús Alfredo Hernández Alarcón. All rights reserved.
// Copyright © 2023 Jesús Alfredo Hernández Alarcón. All rights reserved.
//

import Foundation
Expand Down
2 changes: 1 addition & 1 deletion Sources/WhatsNew/Composition/WhatsNewComposer.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2022 Jesús Alfredo Hernández Alarcón. All rights reserved.
// Copyright © 2023 Jesús Alfredo Hernández Alarcón. All rights reserved.
//

import Foundation
Expand Down
2 changes: 1 addition & 1 deletion Sources/WhatsNew/Presentation/FeaturesBuilder.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2022 Jesús Alfredo Hernández Alarcón. All rights reserved.
// Copyright © 2023 Jesús Alfredo Hernández Alarcón. All rights reserved.
//

import Foundation
Expand Down
2 changes: 1 addition & 1 deletion Sources/WhatsNew/Presentation/WhatsNewItemViewModel.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2022 Jesús Alfredo Hernández Alarcón. All rights reserved.
// Copyright © 2023 Jesús Alfredo Hernández Alarcón. All rights reserved.
//

import Foundation
Expand Down
2 changes: 1 addition & 1 deletion Sources/WhatsNew/Presentation/WhatsNewPresenter.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2022 Jesús Alfredo Hernández Alarcón. All rights reserved.
// Copyright © 2023 Jesús Alfredo Hernández Alarcón. All rights reserved.
//

import Foundation
Expand Down
25 changes: 8 additions & 17 deletions Sources/WhatsNew/UI/WhatsNew.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//
// Copyright © 2022 Jesús Alfredo Hernández Alarcón. All rights reserved.
// Copyright © 2023 Jesús Alfredo Hernández Alarcón. All rights reserved.
//

import SwiftUI

public struct WhatsNew: View {
@Environment(\.presentationMode) var presentationMode
@ObservedObject var viewModel: WhatsNewViewModel

init(viewModel: WhatsNewViewModel) {
self.viewModel = viewModel
}
Expand Down Expand Up @@ -39,22 +39,13 @@ public struct WhatsNew: View {
}.padding()
}
.padding()
.modifier(WithNavigationBarTitleDisplayModeIfAvailable(displayMode: .inline))
#if os(iOS)
.navigationBarTitleDisplayMode(.inline)
#endif
}
#if os(iOS)
.navigationViewStyle(.stack)
}
}

struct WithNavigationBarTitleDisplayModeIfAvailable: ViewModifier {
let displayMode: NavigationBarItem.TitleDisplayMode

func body(content: Content) -> some View {
if #available(iOS 14.0, *) {
content
.navigationBarTitleDisplayMode(displayMode)
} else {
content
}
#endif
}
}

Expand All @@ -68,7 +59,7 @@ struct WhatsNew_Previews: PreviewProvider {
WhatsNew(
viewModel: WhatsNewViewModel(
state: WhatsNewState(
title: "Maps",
title: "Maps",
features: featuresBuilder.build()
), didTapContinueButton: { buttonTappedCount += 1 }
)
Expand Down
2 changes: 1 addition & 1 deletion Sources/WhatsNew/UI/WhatsNewHeaderView.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2022 Jesús Alfredo Hernández Alarcón. All rights reserved.
// Copyright © 2023 Jesús Alfredo Hernández Alarcón. All rights reserved.
//

import SwiftUI
Expand Down
14 changes: 4 additions & 10 deletions Sources/WhatsNew/UI/WhatsNewItemView.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2022 Jesús Alfredo Hernández Alarcón. All rights reserved.
// Copyright © 2023 Jesús Alfredo Hernández Alarcón. All rights reserved.
//

import SwiftUI
Expand All @@ -19,15 +19,9 @@ struct WhatsNewItemView: View {
.frame(width: 48, height: 48, alignment: .center)
.foregroundColor(.accentColor)
VStack(alignment: .leading, spacing: 4) {
if #available(iOS 14.0, *) {
Text(whatsNewItem.title)
.font(.title3)
.bold()
} else {
Text(whatsNewItem.title)
.font(.title)
.bold()
}
Text(whatsNewItem.title)
.font(.title3)
.bold()
Text(whatsNewItem.subtitle)
.multilineTextAlignment(.leading)
.frame(maxWidth: .infinity, alignment: .leading)
Expand Down
2 changes: 1 addition & 1 deletion Sources/WhatsNew/UI/WhatsNewViewModel.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2022 Jesús Alfredo Hernández Alarcón. All rights reserved.
// Copyright © 2023 Jesús Alfredo Hernández Alarcón. All rights reserved.
//

import SwiftUI
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2022 Jesús Alfredo Hernández Alarcón. All rights reserved.
// Copyright © 2023 Jesús Alfredo Hernández Alarcón. All rights reserved.
//

import WhatsNew
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2022 Jesús Alfredo Hernández Alarcón. All rights reserved.
// Copyright © 2023 Jesús Alfredo Hernández Alarcón. All rights reserved.
//

@testable import WhatsNew
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2022 Jesús Alfredo Hernández Alarcón. All rights reserved.
// Copyright © 2023 Jesús Alfredo Hernández Alarcón. All rights reserved.
//

@testable import WhatsNew
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2022 Jesús Alfredo Hernández Alarcón. All rights reserved.
// Copyright © 2023 Jesús Alfredo Hernández Alarcón. All rights reserved.
//

@testable import WhatsNew
Expand All @@ -24,7 +24,7 @@ class WhatsNewPresentationTests: XCTestCase {
if value == key {
XCTFail("Missing localized string for key: `\(key)` in table: `\(table)`", file: file, line: line)
}
if let param = param { return String(format: value, param) }
if let param { return String(format: value, param) }
return value
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2022 Jesús Alfredo Hernández Alarcón. All rights reserved.
// Copyright © 2023 Jesús Alfredo Hernández Alarcón. All rights reserved.
//

import Foundation
Expand Down
Loading

0 comments on commit 2898907

Please sign in to comment.