-
-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug-Fix issue: 182 Picker in AddMaintainanceView is not working #196
Bug-Fix issue: 182 Picker in AddMaintainanceView is not working #196
Conversation
Updated the vehicle picker to user the vehicle id and not the vehicle object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this work using the Vehicle
object as opposed to the id? if not use the id and change the variable to selectedVehicleID
Also there's some indentation that's incorrect, your Xcode should be set to 4
spaces
…object -As per the documentation in order to allow the picker to user an object the tag object has to match the selectedVehicle type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nevermind sorry for the confusion, go ahead and use the id
, that's how it's done in the AddOdometerReadingView
Also note you don't need the vehicle as Vehicle
anymore because of that, and technically with the current way that you fixed this the if !vehicles.isEmpty
check wouldn't be needed, because you made the selectedVehicle
optional
So I should remove "vehicle as Vehicle" from the tag and replace it with "vehicle.id". |
Yes because it's not necessary to cast the vehicle as it's own type, the goal is to use the |
-Per PR review I have refactor the vehicle picker to use the vehicle id instead of the vehicle object. -Replaced "vehicle as Vehicle) for the text tag and replaced it with vehicle.id -Removed !vehicle.isEmpty check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work! Just a small comment and I can merge this
Basic-Car-Maintenance/Shared/Dashboard/Views/AddMaintenanceView.swift
Outdated
Show resolved
Hide resolved
let event = MaintenanceEvent(title: | ||
title, | ||
date: date, | ||
notes: notes, | ||
vehicle: vehicle) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to push a change to fix the alignment of this
Updated the vehicle picker to user the vehicle id and not the vehicle object
What it Does
The fix allows the user to select a vehicle from the
vehicle picker in the AddMaintainanceView form that
is not the first vehicle in the list.
How I Tested
For example:
etc...
Notes
Screenshot