LOOP-1484: Correction ranges in therapy acceptance flow#12
Conversation
rickpasetto
left a comment
There was a problem hiding this comment.
Some minor comments, but otherwise LGTM! 👍
| weak var completionDelegate: CompletionDelegate? | ||
|
|
||
| let viewModel = PrescriptionCodeEntryViewModel() | ||
| var settingDelegate: ((TherapySettings) -> Void)? |
There was a problem hiding this comment.
if this is just a function, it is not really a "Delegate". Consider calling this onSettingFinished.
There was a problem hiding this comment.
This is a way to save the settings to Loop. Perhaps I'm not understanding the definition of a delegate, but wouldn't it be a delegate in this case because it's interacting with another object to coordinate state?
There was a problem hiding this comment.
Whoever is implementing this is a delegate for saving, but I agree with Rick that since it references a function, and not the delegate itself. Not sure if "save" or "finish" is the right verb. saveTherapySettings or 'onReviewFinished` both seem reasonable, depending on what you intend as possible uses for this function.
There was a problem hiding this comment.
Right, what @ps2 said :). (Any of his suggested functions are fine with me)
| weak var completionDelegate: CompletionDelegate? | ||
|
|
||
| let viewModel = PrescriptionCodeEntryViewModel() | ||
| var settingDelegate: ((TherapySettings) -> Void)? |
There was a problem hiding this comment.
Whoever is implementing this is a delegate for saving, but I agree with Rick that since it references a function, and not the delegate itself. Not sure if "save" or "finish" is the right verb. saveTherapySettings or 'onReviewFinished` both seem reasonable, depending on what you intend as possible uses for this function.
This PR adds an instructional screen & an editor screen for the correction range setting, in addition to the framework (delegates, etc) needed to save the prescription to Loop.
A few notes: