Skip to content

Commit

Permalink
Fix swift6
Browse files Browse the repository at this point in the history
  • Loading branch information
aromanov91 committed Nov 10, 2024
1 parent 08e922c commit daed089
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
import Foundation
import PackageDescription

let remoteDependencies: [PackageDescription.Package.Dependency] = [
.package(url: "https://github.com/oversizedev/OversizeCore.git", .upToNextMajor(from: "1.3.0")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import SwiftUI

#if os(iOS) || os(macOS)
extension EKCalendar: @retroactive Identifiable {
extension EKCalendar: @retroactive Identifiable {
public var id: String {
calendarIdentifier
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import OversizeCore
import SwiftUI

#if os(iOS) || os(macOS)
extension EKEvent: @retroactive Identifiable {
extension EKEvent: @retroactive Identifiable {
public var color: Color {
Color(calendar.cgColor)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Foundation

#if !os(tvOS)
public enum CalendarAlertsTimes: CaseIterable, Equatable, Identifiable, Sendable {
public enum CalendarAlertsTimes: CaseIterable, Equatable, Identifiable, Sendable {
case oneMinuteBefore, fiveMinutesBefore, tenMinutesBefore, thirtyMinutesBefore, oneHourBefore, twoHoursBefore, oneDayBefore, twoDaysBefore, oneWeekBefore, custom(EKAlarm)

public var title: String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Foundation

#if !os(tvOS)
public enum CalendarEventRecurrenceRules: CaseIterable, Equatable, Identifiable, Sendable {
public enum CalendarEventRecurrenceRules: CaseIterable, Equatable, Identifiable, Sendable {
case never, everyDay, everyWorkingDay, everyWeekend, everyWeek, everyTwoWeeks, everyMonth, everyYear, custom(EKRecurrenceRule?)

public var rule: EKRecurrenceRule? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ final class DressWeatherCloudKitService {
}
}

@MainActor
extension DressWeatherCloudKitService: DressWeatherCloudKitServiceProtocol {
public func fetchAccountStatus() async -> Result<CKAccountStatus, AppError> {
do {
Expand Down
10 changes: 5 additions & 5 deletions Sources/OversizeHealthService/BodyMassService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ import OversizeModels
public protocol BodyMassServiceProtocol {
func requestAuthorization() async -> Result<Bool, AppError>
func fetchBodyMass() async throws -> HKStatisticsCollection?
func calculateSteps(completion: @escaping (HKStatisticsCollection?) -> Void)
func getWeightData(forDay days: Int, completion: @escaping ((_ weight: Double?, _ date: Date?) -> Void))
func calculateSteps(completion: @Sendable @escaping (HKStatisticsCollection?) -> Void)
func getWeightData(forDay days: Int, completion: @Sendable @escaping (_ weight: Double?, _ date: Date?) -> Void)
func fetchBodyMass(forDay days: Int) async throws -> [HKQuantitySample]?
func saveMass(date: Date, bodyMass: Double, unit: HKUnit) async throws
func saveBodyMass(date: Date, bodyMass: Double, unit: HKUnit) async throws -> HKQuantitySample
func deleteBodyMass(userWeightUUID: UUID) async throws -> Bool
}

@available(iOS 15, macOS 13.0, *)
open class BodyMassService {
open class BodyMassService: @unchecked Sendable {
private var healthStore: HKHealthStore?

private let bodyMassType = HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bodyMass)
Expand All @@ -51,7 +51,7 @@ import OversizeModels
}
}

public func getWeightData(forDay days: Int, completion: @escaping ((_ weight: Double?, _ date: Date?) -> Void)) {
public func getWeightData(forDay days: Int, completion: @Sendable @escaping (_ weight: Double?, _ date: Date?) -> Void) {
guard let bodyMassType = HKObjectType.quantityType(forIdentifier: .bodyMass) else {
return
}
Expand Down Expand Up @@ -169,7 +169,7 @@ import OversizeModels
}
}

public func calculateSteps(completion: @escaping (HKStatisticsCollection?) -> Void) {
public func calculateSteps(completion: @Sendable @escaping (HKStatisticsCollection?) -> Void) {
let stepType = HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bodyMass)!

let startDate = Calendar.current.date(byAdding: .day, value: -100, to: Date())
Expand Down

0 comments on commit daed089

Please sign in to comment.