NetNewsWire/Multiplatform/Shared/Inspector/InspectorPlatformModifier.swift
Stuart Breckenridge 8f8afb5dbb
Inspector View
Inspector Views for macOS and iOS
2020-07-18 17:34:04 +08:00

43 lines
833 B
Swift

//
// InspectorPlatformModifier.swift
// NetNewsWire
//
// Created by Stuart Breckenridge on 18/7/20.
// Copyright © 2020 Ranchero Software. All rights reserved.
//
import SwiftUI
struct InspectorPlatformModifier: ViewModifier {
@Environment(\.presentationMode) var presentationMode
@Binding var shouldUpdate: Bool
@ViewBuilder func body(content: Content) -> some View {
#if os(macOS)
content
.textFieldStyle(RoundedBorderTextFieldStyle())
.frame(width: 300)
.padding()
#else
NavigationView {
content
.navigationBarTitle("Inspector", displayMode: .inline)
.navigationBarItems(
leading:
Button("Cancel", action: {
presentationMode.wrappedValue.dismiss()
}),
trailing:
Button("Confirm", action: {
shouldUpdate = true
})
)
}
#endif
}
}