What is the view or thing called that pops up in the photos app when you click the leftmost button at the bottom of the screen on the iPhone? - iphone

I want to implement this on my app. I want to search for tutorials on this topic but I don't know what its called. Can someone please tell me what its called? Eg. In the photos app in iPhone, when u click on the left most button at the bottom, a screen pops up from the bottom giving you options to either email image, set as wallpaper etc.. So, once again, what is this called? Thanks

That is a UIActionSheet. Check out the UIActionSheet Class Reference.
Basically you create one with the designated initializer -initWithTitle:delegate:cancelButtonTitle:destructiveButtonTitle:otherButtonTitles: then send the -showInView: message to display it. You'll have to set yourself as it's delegate in order to handle selections made by the user.

The button is the 'action' barButtonItem type.
The button then opens a modal sheet. Opened with something like:
[self presentModalViewController:menuViewController animated:YES];

Related

UINavigationButton & UIButton on PopToRootViewController?

My app has a sign in button and a sign up button, which are UINavigationButtons and UIButtons respectively. Either segues to a new screen that, on success, should PopToRootViewController; However, when I successfully sign in, my sign in and sign up buttons are still present. I have a method that decides whether or not to display the buttons that gets called in the viewDidLoad method. Thus, when I stop/run the app again, the buttons disappear as they should. Can anyone give me advise on how to get these buttons to hide? Thank you.
Bonus points: I also have a log out button that has a similar issue; I have to re-run the app before my view controller realizes it should hide the logout button and show the sign in/up buttons.
The problem is that viewDidLoad is only called once, so it is hardly suitable for this purpose; it has to do with the view coming into existence, and nothing to do with the interface. Use viewWillAppear: and make the decision about whether to show or hide the buttons on the basis of, say some info you've stored in NSUserDefaults (like, has the user signed in or not).

How to create a small popup in iOS?

I'm looking for the simplest code in order to implement a small popup (NOT a full screen modal popup or alert view). I just need it to display some basic text inside the popup, then exit it when I click away. The popup in the EleMints app is a good example.
UIPopoverController does this, but it's limited to iPad only. If you need this on iPhone, just implement a custom UIView subclass. Then when you want to show your popover, instantiate the subclass and add it to your view, maybe with some animation.
You can use WEPopOver as that is the one you required. For more info, visit this link
You can also use the following refrence link for UIPopOver controller
1) WEPopOver Library
2) Popup Bubbles

iOS action sheet

I'm using UIActionSheet in one of my applications and I have a question . When the action sheet comes to front , everything else goes in background and I cannot interact anymore with my buttons or other objects in my view until I dismiss the action sheet . Is there a way to disable this feature ? I mean , if I have the action sheet displayed , can I still be able to use what goes in background ? If there is a way , I would really appreciate if you could show me how to do it.
There is no way to access the Background controls, If the UIActionSheet or UIAlertView comes to the front.
The action sheet is supposed to be modal. All user input will be captured by the action sheet until it is dismissed. So all the background controls cannot be interacted with by the user until it is gone.

add new window or view on the alertview click button in iphone

i juzz want to know that how we can add new window or view on the click of an alertview button in iphone?
I'm not sure you can do that from an AlertView since alertviews are meant only to display a specific alert not to take an action. I guess you better off using an ActionViews which is recommended by Apple if you want to perform a certain action from a model view in iphone.
Regards,

How can we disable the button in my iphone app?

In my application, there is one button in the navigation bar. I want it to work only for the 1t click of the user. If he continousally presses on it 2 or 3 times just after the 1st click the button shouldnt recieve the following ones. How can I do this?
My app always crashes if the user presses it for more than once. I dont want to make it multithread and use lock. Thats why i want to know whether there is anyother alternative.
(If the app crashes by pressing more than once then there's a bigger problem.)
Since the button is on the navigation bar, that's a UIBarButtonItem, not a UIButton. The UIBarButtonItem has an enabled property which you can set to NO to disable the button.
(If it is really a UIButton, don't worry, it also has an enabled property.)
After the user clicked the button, you could set the "enabled" property to NO and after the action finished, set it back to YES
http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIControl_Class/Reference/Reference.html#//apple_ref/occ/instp/UIControl/enabled
Luckily this is pretty easy to do. The UIBarItem class has an enabled property. Just set it to NO once the user taps it.