ReadKeep/readeck/Domain/UseCase/GetCacheSizeUseCase.swift
Ilyas Hallak 4fd55ef5d0 Refactor settings to use Clean Architecture with ViewModels
- Add cache settings UseCases (get/update size, clear cache)
- Create CacheSettingsViewModel and OfflineSettingsViewModel
- Replace direct UserDefaults access with repository pattern
- Add CachedArticlesPreviewView for viewing offline articles
- Integrate offline settings into main SettingsContainerView
- Wire up new UseCases in factory pattern
2025-12-01 21:56:13 +01:00

18 lines
422 B
Swift

import Foundation
protocol PGetCacheSizeUseCase {
func execute() async throws -> UInt
}
class GetCacheSizeUseCase: PGetCacheSizeUseCase {
private let settingsRepository: PSettingsRepository
init(settingsRepository: PSettingsRepository) {
self.settingsRepository = settingsRepository
}
func execute() async throws -> UInt {
return try await settingsRepository.getCacheSize()
}
}