Swift: how to change the text of buttons in UIImagePickerController? - swift

Could you please explain how to change the text of "Use Photo" and "Retake" buttons in image picker using Swift? I need to substitute them with an italian translation. I have found something in Objective-C but I don't know that language and I am not even sure it was for my case... Thank you

you need to make a UIImagePickerView as overlay view.
you can follow this solution
Change UIImagePicker Buttons

Related

Adding a background image to UIBarButton Item using interface builder - Beginner

I added a UIToolBar from Interface builder, then dragged 2 UIBarButtonItem's. Now i need to add an image to it. So i selected the barButtonItem and selected the image using Interfacebuilder.
I only get a White image, with no curvy edge. My image is as follows. I don't see that image, but instead i see a white rectangle.
How do i prevent this. Can someone tell me whats wrong, and provide me with a working solution.
my bar button
If you go to iOS Human Interface Guidelines you will see the specifications for icons and buttons. This is my experience, for the best result you'd better create a specific icon (image) for UIBarButtonItem. If you still want to use an image, that doesn't follow the UIBarButtonItem guide, my approach is:
Add a generic UIButton instance to your view. Drag it from the list on the right to the view, not to the ToolBar or navBar.
Customize it with the image, i.e. from the Inspector, set the image or background image, or set it to custom style, bordered, etc.
Drag it to the toolBar, and XCode will adjust it. Again, it does not always guarantee the best result, but it does what you want.
I hope it helps.
You should drag an "Image View" on to your layout and specify the image in that - that worked for me, but I'm no xcode guru.
Hope that helps, Paul

Iphone Alert Box Like Volume Buttons

i would like to create a message box similar to which appears when the volume buttons are pressed.
Anyone knows how to do it? Thanks
Check the MBProgressHUD project:
https://github.com/matej/MBProgressHUD
http://blog.elucidcode.com/2011/03/using-a-hud-to-display-alerts-in-ios/
You can customize your own UIView based on your needs. You can reduce alpha content for the view to get the transparent effect. You can add anything to your view.

Changing Navigation Bar of UIImagePickerController

I am trying (and failing) to change the navigation bar of the UIImagePickerController .
self.pickerController.navigationBar = myCustomBar;
doesn't work, since navigationBar is readonly.
I still want to change the buttons (and colors) on the default "cameraControls" bar.
Do you know of any way to do that?
Thanks!
=============
Ok.. Thanks for the quick answers! So let me detail a little bit here...
For my application I only need the camera feed, and then I want to add my own buttons to a controls bar. I am not interested in photos (not yet anyways). Do you think it's best that I drop the UIImagePicker and just search for something else?
Thanks a lot!
You should consider hiding the original camera controls using the showsCameraControls and set your own controls using a cameraOverlayView. Both are properties of UIImagePickerController.
You might try searching the subview tree of the UIImagePickerController, finding the camera controls bar and hiding that. Then add a new subview with your controls to replace it.

How do I show a small option view on clicking bar button item?

I have a requirement to pop up a small option-view on clicking bar button item, similar to this image.
How can I achieve this? Any tutorial or link is highly appreciated.
I'm not sure this is available on iPhone but I know that on iPad UIPopoverController it looks so.
Apple Documentation
You can find source code here to create PopoverController on iPhone !
You need to create an UIView and set for backgound you image. In this new view you can add UIButtons to let the user to select an option.

Implementing "add photo" button similar to the iPhone contacts app

I was curious if anybody knew the process to create an "add photo" image tile similar to that in the iPhone contacts app. It seems to be on the same level as a UITableViewCell which is shortened (if this is the way it is done).
I've read a suggestion dealing with Headers or custom UITableViewCells but nothing definitive on how it was done. Any illustrative code snippets would be most welcome.
Thank you for any replies.
It's just a UIButton added to a UITableViewCell. You can simply use the addSubview method of the UITableViewCell to add a button to the cell.
It is a header. Most of the functionality is in the 'HeaderFooter' example from the apple developer site. In that example they use a UIImageView for the photo area, but you can implement it with a UIButton instead. If you do this, just set the text to 'Add Photo' when desired, with a blue bold font of about size 12. If you want to leave it as an imageView, you'll have to put a subview with the text on top of it.
The name part can easily be recreated with a UIButton with a PNG image of a detail disclosure icon set as the button Image. It really looks like a small UITabelViewCell.
If you really want you can use a tiny UITableViewCell instead of the PNG for to render the detail disclosure icon, but that's a heavier, more kludgy solution.