GBA003/DeltaFeatures/Types/DisplayInlineKey.swift
2024-05-30 10:22:15 +08:00

28 lines
547 B
Swift

//
// DisplayInlineKey.swift
// DeltaFeatures
//
// Created by Riley Testut on 4/11/23.
// Copyright © 2023 Riley Testut. All rights reserved.
//
import SwiftUI
public struct DisplayInlineKey: PreferenceKey
{
public static var defaultValue: Bool = false
public static func reduce(value: inout Bool, nextValue: () -> Bool)
{
value = nextValue()
}
}
public extension View
{
func displayInline(_ value: Bool = true) -> some View
{
self.preference(key: DisplayInlineKey.self, value: value)
}
}