sort images on image picker grid view
This commit is contained in:
@@ -13,12 +13,16 @@ struct ImagePickerGridView: View {
|
||||
@State var column = Array(repeating: GridItem(.flexible(), spacing: 10), count: 7)
|
||||
let pickedImageClosure: ((CustomWidgeImageOptions) -> Void)
|
||||
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = .black
|
||||
|
||||
|
||||
let imageOptions = CustomWidgeImageOptions.allCases.sorted(by: {
|
||||
$0.rawValue < $1.rawValue
|
||||
})
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
ScrollView {
|
||||
LazyVGrid(columns: column,spacing: 10, content: {
|
||||
ForEach(CustomWidgeImageOptions.allCases, id:\.self) { item in
|
||||
ForEach(imageOptions, id:\.self) { item in
|
||||
Image(item.rawValue)
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
|
||||
Reference in New Issue
Block a user