Created
April 11, 2021 13:57
-
-
Save thatswiftguy/48cce14968aed3a9584176310e579d8f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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