Intercept touch on Camera button to control taking picture - iphone

I would like to intercept the touch on the camera button to control exactly when I take the picture by using takePicture. I still want to use the standard UI control (so I would prefer not having my custom controls in the overlay).
Touch -> Button Clicked -> My code -> takePicture
(ie. Apple code for taking picture won't be called)
Thanks!

Just place a transparent button over standard controls and set it to Your custom function.

Related

How do I set double tab confirmation to new ios home slide-button?

I'm developing a swift game that involves a lot of finger-dragging through the whole screen. The problem is that with the new ios home "button-slide", I find myself out of the game when i get close to the bottom or the top of the screen.
I would like to add a doble tap enabling like Brawl Start has, you first need to tab the bottom bar, and only then it is available to swipe up.
Is it possible to implement?
Thank You.
iOS 11 added the preferredScreenEdgesDeferringSystemGestures property to UIViewController:
Normally, the screen-edge gestures defined by the system take precedence over any gesture recognizers that you define. The system uses its gestures to implement system level behaviors, such as to display Control Center.
Whenever possible, you should allow the system gestures to take precedence. However, immersive apps can use this property to allow app-defined gestures to take precedence over the system gestures. You do that by overriding this property and returning the screen edges for which your gestures should take precedence.
If you change the edges preferred by your view controller, update the value of this property and call the setNeedsUpdateOfScreenEdgesDeferringSystemGestures() method to notify the system that the edges have changed.

How can I move the window without titleBar and fully filled with webView?

I'm working on something similar to the native picture in picture.
I want to move this window, but can't because there is no titlebar (it's hidden and window.stylemask is fullSizeContentView) in it and it's fully filled with the webView.
So, I can't just click on titlebar and drag to move this window.
P.S.
Sorry for my english. I hope the goal is clear
You can subclass the webview to catch -mouseDown: events, and then pass the NSEvent to -[NSWindow performWindowDragWithEvent:].
Apple has sample code which uses this technique to start a window drag after the mouse moves some minimum distance, while still handling normal clicks. If you want to support basic interaction with the webview, this might be a good approach.
(Overriding -mouseDown: seems to work for WKWebView, it may not work with the legacy WebView. It's a bit of a hack, but you could use an overlay view to catch those events instead.)
If you remove the two lines with highlight(true) (line 18) and self.highlight(false) (line ~40) the sample code works also for WKWebView.

how to use animation to show the calendar

I can successfully show the calendar when clicking on the button using property called alpha. To show a calendar I am doing
calendar.alpha = 5
To hide by clicking, I am doing
calendar.alpha = 0
This is just very simple thing.What I am looking for is some animation to show and hide calendar.
Here's some images
Above is the textfield and a button. When you click on a button, calendar will show like below
Question :
How can I animate the effect such that it looks like when you are browsing the photo in your Album. If you dont like one of the photo you click a trash icon at the bottom right and the photo will slide into the a trash. So with this example, when I click on the button, I calendar will slowly show from a button and fully display onto the screen eventually
*Edit: I think the effect called suckEffect in iphone
That suck effect can't be done with Core Animation. To achieve that one, you would need OpenGL.
While that would be a cool effect, it's probably not worth it. Though, I think you might want to add the tag 'opengl' to your question. That might draw the attention of some OpenGL developers who might be able to offer more specific suggestions.
one more thing value of opacity vary from 0-1 you are using 5 its ok but 1 is maximum.
you can also use jquery function like .show() , .hide() or .toggle() method for show hide your calender and animation http://api.jquery.com/category/effects/

How to create function that works take photo shoot+ save

I want to create an iphone app that if you shoot using the camera it automatically save and shoot again until you click Done.
is that possible?
Look at the takePicture method of UIImagePickerController. From the documentation:
Use this method in conjunction with a custom overlay view to initiate the programmatic capture of a still image. This supports taking more than one picture without leaving the interface, but requires that you hide the default image picker controls.
Since you have to have the default controls hidden, you'll also want to look at cameraOverlayView, which lets you provide your own controls to use instead. That's where you can put your start and done buttons.

iPhone custom Pop Up Message on Click in iPhone

I am learning iPhone and i have seen a beautiful thing in ipHone builtin Photo Gallery.
In the image attached below i can see a small pop up (COPY) in black color is displayed on the pic.
I want some thing like this to implement in iPhone. Can anybody guide me??
Or atleast guide me that how can get the x,y coordinates of the Button i clicked on and then how would i display an image over that Button on the same co ordinates.
I hope you get what i am asking for
Thanks a bunch
Waiting for some positive response
use UIMenuController controller to show the options and forgetting the coordinate of your UIButton use it's frame property.
Check the below blog post
http://ksylvest.com/post/471975163/cocoa-copy-paste-menu
http://intridea.com/2010/12/22/developers-notes-for-uimenucontroller
Use UIMenuController. Since your button is a UIView you can easily get its position on screen.