-
Notifications
You must be signed in to change notification settings - Fork 445
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
Add viberation variations to iOS #1905
Conversation
Android does expose some haptic feedback preset types, but I'm not sure they really have the exact same meanings as iOS, in which case I suppose iOS and Android are sort of incompatible with each other in terms of the types of haptic feedback they expose... I'm not sure how I feel about having a function which does radically different things (and effectively accepts different parameters) depending on the platform. I guess it was like that a little bit already, but this makes the difference even bigger. |
*/ | ||
virtual void vibrate(double seconds) const; | ||
virtual void vibrate(double seconds, const std::string &mode) const; |
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 think this should use an enum here (like the PowerState enum in this file, if you need an example to work from) instead of passing the string all the way down to the platform implementation.
{ | ||
@autoreleasepool | ||
{ | ||
if (mode != "default" && @available(iOS 10.0, *)) { |
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.
love's code style has braces on a separate line from if-statements. Also for single lines inside a conditional (like below), the braces can be removed.
Well, currently Android would switch between haptic vibration and normal long vibration depends on how long the vibration is, while iOS could only provide a constant 500ms vibration, and that's a big difference. Different platforms accept different params do sounds bad, so I'm considering tweaking iOS's vibration only with the |
This pull request is for #1904