-
Notifications
You must be signed in to change notification settings - Fork 215
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
Exposed doneButton enabled variable and added option to avoid auto-selection of day when releasing scrolling #112
base: master
Are you sure you want to change the base?
Conversation
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.
Thank you @palla89 for the contribution! As mentioned in one of the comments below, I'm not fond of disabling auto-selection so I'd like to ask you to remove it from this PR if you don't mind. I also have a few comments on the done button update, please take a look 😄
public var doneButtonIsEnabled: Bool = true { | ||
didSet { | ||
doneButton.isEnabled = doneButtonIsEnabled | ||
} | ||
} |
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.
A few nits:
- I think it's nicer if we use a method instead of this long awkward variable name. So instead we can have something like:
func enableDoneButton(_ enabled: Bool)
. - The indenting doesn't quite match with the rest of the file, can you please update it?
- When the done button is disabled, I find that it still looks the same as when it's enabled so it doesn't look obvious and can be mistaken with an issue. How about updating the button's look (i.e make it grey) when it's disabled?
@@ -260,6 +266,9 @@ public protocol DateTimePickerDelegate: AnyObject { | |||
timeZone = calendar.timeZone | |||
} | |||
} | |||
|
|||
public var autoSelectDayOnStopScroll: Bool = true |
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.
I'm not quite fond of this feature, as although someone requested it I find it looks buggy and not what I intended for the library. I think it's fine if someone wants it for their app, they can maybe tweak it to their need; but I'd prefer to leave it off the library for now. WDYT?
var is
doneButtonIsEnabled
and the other var isautoSelectDayOnStopScroll