How to receive notifications when moving Window by mouse? - cocoa

I tried -setFrame:display: and -windowDidMove: but they are not sent while moving window.

If You want to track NSWindow live moving, it's not possible by default You’ll have to do it on your own. It's possible to get notification when NSWindow is started to drag (move) with NSWindowWillMoveNotification or ended dragging (moving) - NSWindowDidMoveNotification.
Take a look at these examples they can help You to solve live window moving problem:
1. Example:
Description: Very short category on NSWindow that makes windows post
NSWindowDidMove notifications continuously during dragging (much like
NSWindowDidResizeNotification behaves). Uses a secondary thread and
behavior can be toggled.
Download link.
2. Example:
Project download link.

You can register an observer for NSWindowDidMoveNotification.

Related

Call indicator bar is not responding for audio and video call

I have implemented Twilio voice kit successfully in the application.
I am not able to move in the application from call indicator. Also, I am not able to see green bar on other application screen when user moves from call screen. I have added custom view in navigation bar, but it's not much responsive.
I have following doubts for the same.
Is there any default property which I need to enable to display
native call indicator in the application?
Do I need to put a custom
view as I have done? If yes then what will be the best approach to do
it?
Is there any alternative to display custom call indicator inside
the application rather than adding view in navigation bar?
Any help will be appreciated.
Thank you.
As far as I know, CallKit framework does not have any API for you to use to display their native UI regarding the calls. The green indicator bar is shown if you have an active VoIP call and your app is running in background.
By tapping on it it will just open your VoIP app.
The best approach is to use a custom-built UIView, placed on a separate UIWindow that has the same level as the system's status bar and add a tap gesture on it to achieve what the native green bar is doing. Also, you can even add the animation that fades in and out a label to create the same experience as the native green bar.

Quartz Composer mouse hover and scroll

I'm really new to origami and quartz. I've only spent a few hours on it today and am still a little lost.
I'm trying to show some interaction for a website in a web browser. What patch would I use to register a mouse hover on a button or window? More specifically I've attached a link to show what kind of interaction i'm trying to achieve (Living Options section).
Also how do you use the mouse scroll patch?
Thanks
To register a mouse hover, you would use the setup pictured above. First you need to define a Hit Area (the area to be hovered). Plugged into this you need an Interaction patch. Finally, you need to define which kind of mouse interaction you want to track – in this case Mouse Over. You have have a number of options here:
Plug the Mouse Over output port into another patch, e.g. the Text patch.
Create a Wireless Broadcaster (pictured) to send the interaction anywhere else in your composition (via a Wireless Receiver).
Publish the output up one layer. To do this, hover over the desired port and hit 'p'. The output will now be available from the parent patch.

How do I receive notification from UIImagePickerController that a Photo has been touched?

How do I receive notification from UIImagePickerController that a Photo has been touched?
I am using a SVProgresHUD which is best stopped in imagePickerController: didFinishPickingMediaWithInfo:
but where to start it?
What I need is is another delegate function notifying the app that the
user has touched the photo of choice, so that the HUD can be started.
The UIImagePickerController using iPhone Photo Library is started from the main thread in my
findPhotoAction:
This is the last place in my code that I could start the ProgressHUD. It is wrong to start the HUD
at that point. The user clicks through the following before actually touching the desired photo (which is the proper place to
launch the ProgressHUD.
Camera Roll item in picker's UITableView
Touch Desired Photo
Can you please suggest a solution? Do I need a custom UIPickerController?
Thanks very much, Mark
I found everything I needed from Ray Wenderlich
http://www.raywenderlich.com/1888/how-to-create-a-simple-iphone-app-tutorial-part-33
Thanks for reading.

WP7: Is it possible to intercept the backstack before the journal thumbnail is created/stored

You all know the Windows Phone backstack right. If you go through some apps, tap the Home key after starting each app. Now tap and hold the Backkey to see the Backstack. You can now see some small images of your apps, and can pick which one to go to right.
Question:
Is it possible to intercept before the backstack image is created? I have tried to blur my page in various events (include OnNavigatingFrom) to no avail.
My guess is some other event (probably something we don't have access to) is triggered and a bitmap is created, because when you use the Backstack to navigate you can just see a slight transition from the saved image to a real page IMO.
Does anyone know if its possible to intercept or manipulate these images on the backstack?
Example screenshot from WP emulator of the Backstack thumbnails
Following my comment, I've just tried this:
Set a breakpoint anywhere in the code
Start the app with the debugger attached, then let it reach the breakpoint
While the execution is stopped by the debugger, long press on the back button
The task switching UI is displayed even though the managed code execution is stopped
From there, I think we can safely conclude that the task switching and the thumbnail are handled entirely by native code. Therefore, there's nothing you can do.
I recently wrote a blogpost in which I discuss the ways I tried to hide data from the application snapshot. (You can read it here: http://corstianboerman.com/trying-to-hide-crucial-data-from-an-application-snapshot/)
The outcome: You just can't hide it.

Any possibility to get a notification if another application receives a scroll event?

I'm developing an application in Cocoa which allows users to draw on any given window in OS X. The drawings move along with the corresponding window when dragged on screen. To complete this tie between drawings and the windows (and their contents) beneath, I'd like to catch scrolling events from the window in order to react on the positioning/visibility of the drawings.
An example:
The user opens Safari and browses the web. On a specific website s/he draws a circle around a link and takes hand written notes (this is all considered a drawing, input by a pen tablet). Afterwards s/he moves the window, the drawings are also being moved so that they remain on top of the link on the website. Then s/he begins to scroll the website and the location of the link changes (moves up until it's outside of the viewport).
Now I'd like to catch that event and also move the layer with the drawings to keep them on top of the link. When the link is no longer visible, I'd turn off the visibility of the drawing and turn it back on when scrolling brings the link back on to the viewport.
I know this is a quite tricky assignment and being able to intercept such events from another application might as well be considered an OS security flaw but maybe someone out there is good enough a coder to give me a hint... :)
The Cocoa Accessibility classes may be helpful but until now I haven't found the solution.
Thanks for your help.
Oh, and if that's not tricky to you, maybe you can tell me how to get notified when Safari switches Tabs ;)
kkthxbai
I'm not sure if you can monitor scroll events. However, it's a lot easier if you just monitor the position of the link with the Accessibility API.
Just hold a reference to that link and constantly poll it for its position, if the position changes, you know what to do.
You could also try using AXObserverAddNotification, but as far as I am aware, there is no notification you can monitor for position changes.
If you haven't discovered it already, the Accessibility Inspector can help you a lot with identifying things that you can get using the Accessibility API and pfiddlesoft's UI Browser lets you register for notifications.

Resources