Xcode scrollView that changes its y position using Swift 2 - ios

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!

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

Swift: UIButton un-clickable overlapping views

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.

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.

Present UIPopoverController from a moving rect

Just got this weird problem, where I have a scroll view and buttons in the scroll view. I want to display a UIPopover from the button when touched, with UITextFields inside the UIPopover. The problem comes when the Keyboard appears. In certain cases, when the UIButton is so high in the view that the popover can only be displayed under it with the UIPopoverArrowDirectionUp, and when keyboard pops in, this popover cannot move any more up and therefore magically disappears to the top left corner (probably some Apple thing).
My solution is to check the frame of the UIPopover and to check that there is enough space for the keyboard, and if not, scroll the UIScrollView up with the buttons as well in order to be able to push the UIPopover up and so make sure that both the Keyboard and the popover fit.
So the question is: Is it possible to move the popover as the button moves?
Thanks

How do I make a button slide to reveal like the UITableView delete confirmation button?

I would like to re-create the animation of the delete confirmation button that Apple uses in the default implementation of UITableView. I want to create this button and animation in my own custom view area, but haven't been successful in finding a proper view transition or animation. Here is a picture of the reveal animation half way through:
And here is a picture of the animation after it has finished:
These are screenshots from a YouTube video that shows how the button animation is supposed to look.
Thanks!
Basically,
1) Put a button inside a view of the same size as the button, with the autoresizing masks of the button set to force it to not shrink when the view changes size, and have a left flexible margin.
2) Animate the view's frame to change from 0 width to full width while moving from x origin to (x - view width) origin.
As the view grows the button will be revealed. The view should have clipToBounds set to yes.

Resources