Swift: UIButton un-clickable overlapping views - ios

when I'm unwinding a segue by clicking on a button with a cross image which is 1/4th inside a UIView and 3/4th outside the UIView now when I press on button the part which is inside the UIView then unwind segue works but if I click outside of UIView then it does not works.
As you can see from above image if I click inside the blue line then other view controller opens and If I click outside blue line of cross button the unwinding of segue does't work, why?
You can View the Video
<img src="https://i.imgflip.com/24bh0k.gif" title="made at imgflip.com"/>

The cross button seems to be inside the card view rather than superview. Put the button inside superview, over the card view but outside the card view.
Do something like this

take the button up on the view and set its constraints properly . May be your problem will resolved.

Related

Rounded button above the UISCROLLVIEW

I have been working in a project which has a uiscroll view where the uiscroll view size is set programatically with height 225 and width is self. I have created two uiimageView where it displays two images and I have animated it by moving using a page view controller. Finally the image moves atomically like a slide show with page view controller. I have removed the navigation controller do I need to keep a back button for navigation when I place a unbutton above uiscrollview it was stating like scrollview ambitious scrolling content. I need to place a rounded back button above scroll view. I have attached the image of my storyboard. When I tried to place a button it is not visible in stimulator header scroll view is the UISCROLLVIEW where the animated image is placed

Xcode scrollView that changes its y position using Swift 2

Here's my setup: I have a ViewController that contains an image(button). This button takes the user to another viewController using an #IBAction func (tab controller tab). However, I also want a scrollView on the initial ViewController, just under the image button.
What I'm trying to achieve is the ability to scroll content on top of the image button as if it were another page on top of the image button. As the user scroll back down, the image button is revealed underneath the scrollView and is clickable again.
I can't seem to find a solution anywhere online. My scrollView is either fixed below the image button, or covers the image button rendering it unclickable.
Here's a screenshot
take a look at the demo project i set up:
https://github.com/slotti85/ButtonAndScrollView
i...
put the scrollview all over the screen (also over the button),
set up a contentInset to make the button visible initially,
subclassed UIScrollView and
overrode the pointInside function to make the scrollview forward a touch if the "transparent area" is tapped.
hope it helps!

tab view like button slides up

I am trying to have a button that is located on the bottom and when the user taps on it it will slide up to show the menu. How is this possible using code or is there an api or anything that I can use to make this possible in the easiest way?
Your screenshot shows a view whose frame is animated when the button is pressed so that either the height of the view, or more likely just the position, is changed so that the view becomes visible. This is a simple UIView animation and the view being added so it is hidden behind the button initially.
Check out the iOS documentation for Animating Views https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/AnimatingViews/AnimatingViews.html
You should be able to create the view and its content either with the interface builder or in code. Start with the view off the bottom of the screen and then use animateWithDuration:animations: using the frame property.

View Hierarchy not prepared for constraint

I am trying to make a tab system in my app such that when a UIButton is tapped, the view switches and a line moves from the other tab button to under the button that was just pressed, and the same for the other tab button. I am doing this by creating a UIView for the green line and two UIButton's for the tab buttons. Both the Buttons are hooked up to IBActions which remove a constraint that ties it's center.x to the old tab button's center.x and add a constraint that binds it to the new tab's button's center.x. However, the button needs to start aligned to the first tab, and when I try to add that constraint programmatically in viewDidLoad, it crashes with "View Hierarchy not prepared for constraint". I cannot add this initial constraint in IB because I need some way to remove it when the next button is pressed.
I will be happy to provide code or more details if needed.
Thank you

Avoid UIButton overlay on UIPickerView ios

I am started to learn iOS. I am doing small app. In that I placed UIPickerView and UIButton in ViewController. On view controller tap, UIPickerView will show to the user. On showing, the detail, UIButton also show (overlay on UIPickerView). How can I Put the UIButton back to viewController.
How to avoid inappropriate view.?
See the update button in UIPicker view
this depends on the order you add your subviews to your view. try [viewController.view sendSubviewToBack: yourButton]
in interface builder drag the view you want to place on top of your view hierarchie to the bottom. on the picture UISegmentedControl would overlap the UIButton if not properly aligned.
Go to your xib file and drag your Picker object to the bottom of its container as in the image below:

Resources