Skip to content

Instantly share code, notes, and snippets.

@thatswiftguy
Created April 11, 2021 13:57
Show Gist options
  • Save thatswiftguy/48cce14968aed3a9584176310e579d8f to your computer and use it in GitHub Desktop.
Save thatswiftguy/48cce14968aed3a9584176310e579d8f to your computer and use it in GitHub Desktop.
//
// SortPickerView.swift
// TaskManager
//
// Created by Mohammad Yasir on 11/04/21.
//
import SwiftUI
struct SortPickerView: View {
@ObservedObject var taskVM : TaskViewModel
var body: some View {
Picker("", selection: $taskVM.sortType) {
ForEach(SortType.allCases){
Text($0.rawValue.capitalized)
.tag($0)
}
}
.pickerStyle(SegmentedPickerStyle())
.padding()
}
}
struct SortPickerView_Previews: PreviewProvider {
static var previews: some View {
SortPickerView(taskVM: TaskViewModel())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment