Skip to content

Commit

Permalink
Update routing, onboarding and up to Swift6
Browse files Browse the repository at this point in the history
  • Loading branch information
aromanov91 committed Nov 10, 2024
1 parent cfc4250 commit 6ffd82a
Show file tree
Hide file tree
Showing 61 changed files with 515 additions and 540 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "*.*.*"

jobs:
build:
release:
name: Create release
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 3 additions & 3 deletions AppExample/Example (watchOS) Watch App/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
// ContentView.swift, created on 19.05.2024
//

import OversizeKit
import OversizeCalendarKit
import OversizeContactsKit
import OversizeKit
import OversizeLocationKit
import OversizePhotoKit
import OversizeCalendarKit
import OversizeNoticeKit
import OversizeNotificationKit
import OversizeOnboardingKit
import OversizePhotoKit
import SwiftUI

struct ContentView: View {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ import SwiftUI

@main
struct Example__watchOS__Watch_AppApp: App {

@Injected(\.appStateService) var appStateService: AppStateService

var body: some Scene {
WindowGroup {
ContentView()
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<key>Example (watchOS) Watch App.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>2</integer>
</dict>
<key>Example.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
Expand Down
2 changes: 0 additions & 2 deletions AppExample/Example/Screens/Onboarding/OnboardingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// OnboardingView.swift, created on 25.09.2023
//



import Factory
import OversizeServices
import OversizeUI
Expand Down
8 changes: 4 additions & 4 deletions AppExample/Example/Test/TestView.swift
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
//
// Copyright © 2024 Alexander Romanov
// TestView.swift, created on 19.05.2024
//
//

import OversizeKit
import OversizeCalendarKit
import OversizeContactsKit
import OversizeKit
import OversizeLocationKit
import OversizePhotoKit
import OversizeCalendarKit
import OversizeNoticeKit
import OversizeNotificationKit
import OversizeOnboardingKit
import OversizePhotoKit
import SwiftUI

struct TestView: View {
Expand Down
4 changes: 4 additions & 0 deletions AppExample/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// swift-tools-version: 5.6
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
14 changes: 7 additions & 7 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// swift-tools-version: 5.9
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import Foundation
import PackageDescription

let productionDependencies: [PackageDescription.Package.Dependency] = [
.package(url: "https://github.com/oversizedev/OversizeUI.git", .upToNextMajor(from: "3.0.2")),
.package(url: "https://github.com/oversizedev/OversizeCore.git", .upToNextMajor(from: "1.3.0")),
.package(url: "https://github.com/oversizedev/OversizeCore.git", .upToNextMajor(from: "2.0.0")),
.package(url: "https://github.com/oversizedev/OversizeServices.git", .upToNextMajor(from: "1.4.0")),
.package(url: "https://github.com/oversizedev/OversizeLocalizable.git", .upToNextMajor(from: "1.4.0")),
.package(url: "https://github.com/oversizedev/OversizeComponents.git", .upToNextMajor(from: "1.2.0")),
Expand Down Expand Up @@ -43,10 +43,10 @@ if ProcessInfo.processInfo.environment["RELEASE_DEPENDENCIES"].flatMap(Bool.init
let package = Package(
name: "OversizeKit",
platforms: [
.iOS(.v16),
.macOS(.v13),
.tvOS(.v16),
.watchOS(.v9),
.iOS(.v17),
.macOS(.v14),
.tvOS(.v17),
.watchOS(.v10),
],
products: [
.library(name: "OversizeKit", targets: ["OversizeKit"]),
Expand All @@ -58,7 +58,7 @@ let package = Package(
.library(name: "OversizeNotificationKit", targets: ["OversizeNotificationKit"]),
.library(name: "OversizePhotoKit", targets: ["OversizePhotoKit"]),
],
dependencies: productionDependencies,
dependencies: developmentDependencies,
targets: [
.target(
name: "OversizeKit",
Expand Down
38 changes: 19 additions & 19 deletions Sources/OversizeCalendarKit/CreateEventScreen/CreateEventView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import SwiftUI
.controlBorderShape(.capsule)
.controlSize(.mini)
}
.navigationBarDividerColor(Color.onSurfaceHighEmphasis.opacity(0.1))
.navigationBarDividerColor(Color.onSurfacePrimary.opacity(0.1))
.safeAreaInset(edge: .bottom) {
bottomBar
}
Expand All @@ -98,7 +98,7 @@ import SwiftUI
TextField("Event name", text: $viewModel.title)
.title(.bold)
.focused($focusedField, equals: .title)
.onSurfaceHighEmphasisForegroundColor()
.onSurfacePrimaryForeground()
.padding(.bottom, .xxxSmall)
.padding(.horizontal, .small)

Expand Down Expand Up @@ -129,7 +129,7 @@ import SwiftUI
HStack {
Text("All-day event")
.headline(.semibold)
.foregroundColor(.onSurfaceHighEmphasis)
.foregroundColor(.onSurfacePrimary)
.padding(.leading, .xxxSmall)

Spacer()
Expand All @@ -148,7 +148,7 @@ import SwiftUI
var textEditor: some View {
VStack(spacing: 2) {
TextEditor(text: $viewModel.note)
.onSurfaceHighEmphasisForegroundColor()
.onSurfacePrimaryForeground()
.padding(.horizontal, .xSmall)
.padding(.vertical, .xxSmall)
.focused($focusedField, equals: .note)
Expand All @@ -162,7 +162,7 @@ import SwiftUI
if viewModel.note.isEmpty {
Text("Note")
.body(.medium)
.onSurfaceDisabledForegroundColor()
.onSurfaceTertiaryForeground()
.padding(.small)
}
}
Expand All @@ -173,7 +173,7 @@ import SwiftUI
if viewModel.note.isEmpty {
Text("Note")
.body(.medium)
.onSurfaceDisabledForegroundColor()
.onSurfaceTertiaryForeground()
.padding(.small)
}
}
Expand All @@ -183,7 +183,7 @@ import SwiftUI

TextField("URL", text: $viewModel.url)
.focused($focusedField, equals: .url)
.onSurfaceHighEmphasisForegroundColor()
.onSurfacePrimaryForeground()
.body(.medium)
.padding(.horizontal, .small)
.padding(.vertical, 18)
Expand All @@ -209,7 +209,7 @@ import SwiftUI
viewModel.present(.repeat)
} leading: {
IconDeprecated(.refresh)
.iconColor(.onSurfaceHighEmphasis)
.iconColor(.onSurfacePrimary)
}
.rowClearButton(style: .onSurface) {
viewModel.repitRule = .never
Expand All @@ -235,7 +235,7 @@ import SwiftUI
viewModel.present(.invites)
} leading: {
IconDeprecated(.user)
.iconColor(.onSurfaceHighEmphasis)
.iconColor(.onSurfacePrimary)
}
.rowClearButton(style: .onSurface) {
viewModel.members.remove(email)
Expand Down Expand Up @@ -269,7 +269,7 @@ import SwiftUI
viewModel.present(.alarm)
} leading: {
IconDeprecated(.bell)
.iconColor(.onSurfaceHighEmphasis)
.iconColor(.onSurfacePrimary)
}
.rowClearButton(style: .onSurface) {
viewModel.alarms.remove(alarm)
Expand Down Expand Up @@ -303,7 +303,7 @@ import SwiftUI
viewModel.present(.location)
} leading: {
IconDeprecated(.mapPin)
.iconColor(.onSurfaceHighEmphasis)
.iconColor(.onSurfacePrimary)
}
.rowClearButton(style: .onSurface) {
viewModel.locationName = nil
Expand Down Expand Up @@ -356,16 +356,16 @@ import SwiftUI
} label: {
VStack(alignment: .leading, spacing: .xxxSmall) {
Text("Starts")
.onSurfaceMediumEmphasisForegroundColor()
.onSurfaceSecondaryForeground()
.subheadline(.semibold)

Text(startDateText)
.onSurfaceHighEmphasisForegroundColor()
.onSurfacePrimaryForeground()
.headline(.semibold)

if !isCurrentYearEvent {
Text(viewModel.dateStart.formatted(.dateTime.year()))
.onSurfaceHighEmphasisForegroundColor()
.onSurfacePrimaryForeground()
.headline(.semibold)
}
}
Expand All @@ -384,16 +384,16 @@ import SwiftUI
} label: {
VStack(alignment: .leading, spacing: .xxxSmall) {
Text("Ended")
.onSurfaceMediumEmphasisForegroundColor()
.onSurfaceSecondaryForeground()
.subheadline(.semibold)

Text(endDateText)
.onSurfaceHighEmphasisForegroundColor()
.onSurfacePrimaryForeground()
.headline(.semibold)

if !isCurrentYearEvent {
Text(viewModel.dateEnd.formatted(.dateTime.year()))
.onSurfaceHighEmphasisForegroundColor()
.onSurfacePrimaryForeground()
.headline(.semibold)
}
}
Expand Down Expand Up @@ -478,13 +478,13 @@ import SwiftUI
.buttonStyle(.scale)
.padding(.horizontal, .medium)
.padding(.vertical, 20)
.onSurfaceMediumEmphasisForegroundColor()
.onSurfaceSecondaryForeground()
#if !os(watchOS)
.background(.ultraThinMaterial)
#endif
.overlay(alignment: .top) {
Rectangle()
.fill(Color.onSurfaceHighEmphasis.opacity(0.05))
.fill(Color.onSurfacePrimary.opacity(0.05))
.frame(height: 1)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ import SwiftUI
#endif
case .repeat:
RepeatPicker(selectionRule: $viewModel.repitRule, selectionEndRule: $viewModel.repitEndRule)

case .alarm:
AlarmPicker(selection: $viewModel.alarms)
.presentationDetents([.height(630), .large])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import SwiftUI
} leading: {
Image.Date.calendar
.renderingMode(.template)
.foregroundColor(.onSurfaceHighEmphasis)
.foregroundColor(.onSurfacePrimary)
}

Row("Save for feature events") {
Expand All @@ -37,7 +37,7 @@ import SwiftUI
} leading: {
Image.Base.calendar
.renderingMode(.template)
.foregroundColor(.onSurfaceHighEmphasis)
.foregroundColor(.onSurfacePrimary)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/OversizeCalendarKit/Pickers/RepeatPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ import SwiftUI
#if os(iOS)
.keyboardType(.numberPad)
#endif
.textFieldStyle(DefaultPlaceholderTextFieldStyle())
.textFieldStyle(.default)
.focused($isFocusedRepitCount)
case .endDate:
#if !os(watchOS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ import SwiftUI
.fillBackgroundPrimary()
}
Image(systemName: participant.symbolName)
.onPrimaryHighEmphasisForegroundColor()
.onPrimaryForeground()
.font(.system(size: 9, weight: .black))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import SwiftUI
}
.topToolbar {
TextField("Email or name", text: $viewModel.searchText)
.textFieldStyle(DefaultPlaceholderTextFieldStyle())
.textFieldStyle(.default)
.focused($isFocusSearth)
#if os(iOS)
.keyboardType(.emailAddress)
Expand Down Expand Up @@ -98,7 +98,7 @@ import SwiftUI
Spacer()
}
.title3()
.onSurfaceMediumEmphasisForegroundColor()
.onSurfaceSecondaryForeground()
.padding(.vertical, .xxSmall)
.paddingContent(.horizontal)

Expand Down Expand Up @@ -136,7 +136,7 @@ import SwiftUI
Spacer()
}
.title3()
.onSurfaceMediumEmphasisForegroundColor()
.onSurfaceSecondaryForeground()
.padding(.vertical, .xxSmall)
.paddingContent(.horizontal)
.padding(.top, viewModel.lastSelectedEmails.isEmpty ? .zero : .small)
Expand Down
5 changes: 3 additions & 2 deletions Sources/OversizeKit/AdsKit/AdView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public struct AdView: View {
await viewModel.fetchAd()
}
}

case let .result(appAd):
#if os(iOS)
Surface {
Expand Down Expand Up @@ -79,7 +80,7 @@ public struct AdView: View {
HStack {
Text(appAd.title)
.subheadline(.bold)
.onSurfaceHighEmphasisForegroundColor()
.onSurfacePrimaryForeground()

Bage(color: .warning) {
Text("Our app")
Expand All @@ -89,7 +90,7 @@ public struct AdView: View {

Text(appAd.description)
.subheadline()
.onSurfaceMediumEmphasisForegroundColor()
.onSurfaceSecondaryForeground()
}
.padding(.leading, .xSmall)

Expand Down
Loading

0 comments on commit 6ffd82a

Please sign in to comment.