Objective c - Create a tutorial bubble that will hide in background click - ios

(First - i'm sorry about my english:).
I want to create a tutorial bubble that will pop up in some situations while using my app.
I need this popup to disappear when clicking or scrolling on every view in my VC, and i need that these buttons to do what they need to do in this click event and not only dismiss the pop up so then we will need to click on the buttons again.
I have 2 ways to do it, but every one of them have some disadvantage.
the popup view will have a transparent view with frame of the whole VC. this background view will dismiss the pop up in its touchBegin event.
but like that i can't click ob my buttons that below this popup background view.
the second option is to create the pop up without the background transparent background, so all the buttons will be clickable.
but in this situation i don't know how to listen all the buttons click event or table scroll event so i can dismiss the popup.

Related

iOS keyboard prevent UIButton from reacting

I have 3 views illustrated as in the image. View 2 is in View 1, and View 3 is in View 2. Something weird is happening:
When I click the textfield in View 3, the keyboard opens, and at this time the button in View 2 no longer reacts. When I click button 2 with keyboard open, its color changes (notifies me it is clickable), but the event is never fired. If I don't click the textfield to open keyboard, button functions normally, color changes and the event is fired.
However, button 1 in View1 always works normally, doesn't get affected by the keyboard. It took me a while to find out it's the keyboard that makes the difference but I just can't figure out why. Could someone help me a little?

Add an inputview to UIButton for on click event iOS

I am building a page for a Swift iOS app and I want the user to be able to specify the date range for a graph. At the top of my graph I want the user to select a date range by clicking on a button which will gray out the screen and bring up a picker view on the bottom of the screen to select the date range. It's very similar to how the myfitnesspal app does it (below):
As you can see when they click on the calendar button it brings up a pickerview while graying out the rest of the screen and only recognizes touches to the pickerview. I basically want to replicate this kind of method that allows me to bring up a custom picker when a button is clicked.
I have tried using UIActionSheet however that is now deprecated and I've read that an action sheet should not be used for this kind of functionality.
You can do this by designing a view controller such that-
It has a background view that covers entire screen with background color as black with some alpha say 0.3. This view will serve to block out any touches on the views behind it. Basically it will have that translucent background effect.
Have your actual view such as picker view as a sibling of this, add other siblings like the cross button, etc. You can use the cross button to initiate closing of the view.
Present this controller as a child view controller on the controller where you need this.

iOS popover with a close button outside

I need to create below thing
Currently i'm using WYPopover , but I can't create the button since it's outside of the popover. Is there any existing solution out there ? Many thanks
Create a bigger popover UIView holding all your child elements (current popover + button) and make its background transparent or however you wish.
Popover-controller's are exclusively used in iPad. If you want to use in iPhone, you should create it in a custom way.
I am not familiar with the XYPopover in Github, but normally the custom created popover should be dismissed whenever the user taps any place in the screen. That is one of the key feature of the popovers.
Normally the custom popovers are build like, adding a hidden parent view and then the visible image of a popover frame on it.
You should to do the following,
Avoid dismissing the parent view on tap of parent-hidden-view.
Add a close button at the area where you want to show the close button, on top of the parent-hidden-view.
Capture the button click and dismiss the view (remove the view from superview)
How to customize your need
Creating custom popover view is not a big task. It will take maxim one day, try it your self.
One Parent view with clear color
One background image of a popover frame.
View-inside popover (this needs to be customized for UIPopover also).
Close button.

showing a box type-view on click of a button and on click of a tab bar item

In my application, i need to show a dilog-type view when a user clicks on a UIButton. I need to do the same thing when the user clicks on a tabBar item of a UITabBar
Sorry, in order to make myself clear, i had to create it in paint. Should i create a view with background image of the dilog box, and add two buttons in the view accordingly? I also need to give an alert-view like effect to the view when it is shown.
How do i implement it in a tabBarController?
On clicking on the red button, the view with black border should be shown with an alert-view type effect.

iOS connect my view to popup on button press

I have two xibs, one is my title screen with buttons, the other is a more specific window that should come up when one of the buttons is pressed.
This isn't switching the whole screen, just a popup window, where clicking outside of the bounds of that window will make it disappear leaving only my title screen remaining as it was visible behind this popup view. This is similar to my understanding of "modal views".
Anyway I do not quite get how to connect it to the button on my title screen. I have the views made in IB ready to go. I'm not sure if I have declared all objects to satisfaction yet.
From what I understand I think I need a UIViewController or something, but its all a pretty thick fog of information right now
insight appreciated, or links to proper noob sources would be helpful
Does your title screen have a view controller (or is your app delegate the main controller object)? You will want to add an IBAction to that object, connect the button to it, and then present your other view controller modally (or in a popover) from there.
A popover will appear in a small window with an arrow, and tapping outside will close it. A modal view controller typically slides up into place, and you have to press a cancel button to close it. This guide explains how to use a popover. Using a modal view controller is simple if you have a view controller: [myViewController presentModalViewController:nextViewController animated:YES].

Resources