In the apple watch's passcode setting screen the passcode on top updates as soon as a user clicks on the buttons and not after lifting the finger. How can one achieve that in Xcode 6.3? Because the only event that triggers the ibaction is the touch up event
I don't think that behavior is possible with the current version of WatchKit. Apple is likely using their own internal method to accomplish that (as they do with many/most of the default Watch apps). Hopefully we'll get more functionality in the next major update.
Related
I am using BiometricPrompt (androidx.biometric:biometric:1.2.0-alpha01) as an additional security measure in my app if the user configures to do so. But once this is enabled, I would like this to be non-cancellable (disable back button).
For now, if the user presses back button, BiometricPrompt invokes authenticationFailure callback. Is there a way to achieve this? For now I am re-invoking the BiometricPrompt on authenticationFailure but that's quite hacky.
There is a related question here but that's about the biometric prompt dialog. I am using the full screen version.
I have written an Apple Watch app with a complication that works well. But I often accidentally click on that complication, and it opens my watch app.
Is there some attribute to tell the complication that there is no action when I click on it?
As an example, the sunrise/sunset complication has no click action.
No. There is no ClockKit feature which would stop it from launching your app when you (inadvertently) tap your complication.
You can, however, slide your finger away from your complication, which will deselect it, and avoid opening your app.
You can get a feel for this by long pressing your complication, which will indicate that it's selected. If you slightly swipe away from it, it will deselect itself. If you swipe too far, you may bring up a glance or notification.
Apart from deselecting the complication, I'm not sure that there would be a way to handle any inadvertent-versus-intentional interaction, where you might not want the app to be launched. If you can come up with a case, you should submit a feature request to Apple.
In the stock Apple Watch mail app you can swipe left to access more options for an email. How would I go about doing this with a WKInterfaceTable?
According to Apple guideline that it is not possible in watchOS to implement custom gesture as we have in iOS. Because gestures in watchOS manage by OS itself.
What Apple says:
User interactions on Apple Watch generate touch events and gestures, but unlike iOS apps, your Watch apps don’t handle these events directly. The system provides automatic responses for all touch events and gestures, responding in the following ways:
• Taps trigger action-based events in your app
• Vertical swipes scroll the current screen
• Horizontal swipes display the previous or next page in a page-based interface
• Left edge swipes navigate back to a parent screen in a hierarchical interface
When the user taps a button or another control, Apple Watch calls that control’s associated action method. You define action methods for the controls in your interface and use them to respond to user interactions.
More on stackoverflow
Apple guideline
I find the graphical feedback when pressing buttons (WKInterfaceButton) in watchOS2 is very weak. It is hard to see and even Apple seems to thinks this is the case as they e.g. in the unlock screen change the background to white on active buttons. The default behaviour is to dim the whole button.
How can I make a button press cleared in watchOS 2? I can e.g. change the button text color on activity but how do I easily change it back when it is no longer active?
There is currently no way to detect touch-down, or other events, on WKInterfaceButtons like you can on UIButtons on iOS. The only touch event you can detect is touch-up-inside, which calls the IBAction method.
Therefore what you wish to accomplish cannot be accomplished. Something you might consider is animating the button appearance once the action has been triggered. For example in my app upon button tap I animate the button's background color, then animate it back to the original color. That provides more visual confirmation to the user so they are certain the button was tapped.
I'd encourage you to file an enhancement request at bugreport.apple.com if you'd like to have more control with touch events.
From what I see, QApplication::mouseButtons() may return no buttons even when a button is held down. This happens when you have clicked a side of a window for re-sizing. It's coherent with the docs because mouseButtons() reflects the state from the flow of QEvent::mouseButtonPress, etc. However, I need just to know if the button is held down. Does any one know if it's possible through the Qt API?
I think it's not possible. Mouse events outside an application's window are not passed to its event handlers. Dragging mouse borders is one of such events, it's processed by the window system. Another example is clicking on other windows. Usually an application doesn't know what the user does with other windows. You need to install system-wide event listener or use native API features(e.g. GetAsyncKeyState on Windows) to determine that. This behavior is unusual and possibly dangerous. In most cases it's not useful, and it seems that Qt doesn't have this ability.