Ferrite-backup/Ferrite/Views/ComponentViews/Plugin/Source/SourceSettingsMethodView.swift
kingbri 2982c971a8 Pickers: Change to the Picker structure
Pickers used to use a List workaround, change this to use actual
SwiftUI pickers.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-03-30 12:12:14 -04:00

33 lines
930 B
Swift

//
// SourceSettingsMethodView.swift
// Ferrite
//
// Created by Brian Dashore on 3/24/23.
//
import SwiftUI
struct SourceSettingsMethodView: View {
@ObservedObject var selectedSource: Source
var body: some View {
Section(header: InlineHeader("Fetch method")) {
Picker("", selection: $selectedSource.preferredParser) {
if selectedSource.jsonParser != nil {
Text("Website API").tag(SourcePreferredParser.siteApi.rawValue)
}
if selectedSource.rssParser != nil {
Text("RSS").tag(SourcePreferredParser.rss.rawValue)
}
if selectedSource.htmlParser != nil {
Text("Web scraping").tag(SourcePreferredParser.scraping.rawValue)
}
}
.pickerStyle(.inline)
.labelsHidden()
}
.tint(.primary)
}
}