Fix linker errors when building in release mode

This commit is contained in:
Shadowfacts 2024-04-15 22:30:20 -04:00
parent a759731eba
commit 3f370945e6
4 changed files with 16 additions and 16 deletions

View File

@ -8,12 +8,12 @@
import Foundation
import UIKit
struct ThemeKey: MigratablePreferenceKey {
static var defaultValue: Theme { .unspecified }
public struct ThemeKey: MigratablePreferenceKey {
public static var defaultValue: Theme { .unspecified }
}
struct AccentColorKey: MigratablePreferenceKey {
static var defaultValue: AccentColor { .default }
public struct AccentColorKey: MigratablePreferenceKey {
public static var defaultValue: AccentColor { .default }
}
struct AvatarStyleKey: MigratablePreferenceKey {
@ -28,10 +28,10 @@ struct TrailingSwipeActionsKey: MigratablePreferenceKey {
static var defaultValue: [StatusSwipeAction] { [.reply, .share] }
}
struct WidescreenNavigationModeKey: MigratablePreferenceKey {
static var defaultValue: WidescreenNavigationMode { .multiColumn }
public struct WidescreenNavigationModeKey: MigratablePreferenceKey {
public static var defaultValue: WidescreenNavigationMode { .multiColumn }
static func shouldMigrate(oldValue: WidescreenNavigationMode) -> Bool {
public static func shouldMigrate(oldValue: WidescreenNavigationMode) -> Bool {
oldValue != .splitScreen
}
}

View File

@ -7,10 +7,10 @@
import Foundation
struct TrueKey: MigratablePreferenceKey {
static var defaultValue: Bool { true }
public struct TrueKey: MigratablePreferenceKey {
public static var defaultValue: Bool { true }
}
struct FalseKey: MigratablePreferenceKey {
static var defaultValue: Bool { false }
public struct FalseKey: MigratablePreferenceKey {
public static var defaultValue: Bool { false }
}

View File

@ -89,13 +89,13 @@ final class Preference<Key: PreferenceKey>: Codable {
}
}
struct PreferencePublisher<Key: PreferenceKey>: Publisher {
typealias Output = Key.Value
typealias Failure = Never
public struct PreferencePublisher<Key: PreferenceKey>: Publisher {
public typealias Output = Key.Value
public typealias Failure = Never
let preference: Preference<Key>
func receive<S>(subscriber: S) where S : Subscriber, Never == S.Failure, Key.Value == S.Input {
public func receive<S>(subscriber: S) where S : Subscriber, Never == S.Failure, Key.Value == S.Input {
preference.$storedValue.map { $0 ?? Key.defaultValue }.receive(subscriber: subscriber)
}
}

View File

@ -16,7 +16,7 @@ public protocol PreferenceKey {
}
extension PreferenceKey {
static func didSet(in store: PreferenceStore, newValue: Value) {}
public static func didSet(in store: PreferenceStore, newValue: Value) {}
}
protocol MigratablePreferenceKey: PreferenceKey where Value: Equatable {