tab view like button slides up - ios

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.

Related

Swift ios: drag view controller onto screen

Is there any way to drag a view controller onto the current view controller using Swift? I would like to drag from the bottom of the screen and have the new view controller follow the finger. When the finger releases, I want for the view to snap into place. The view controller that I plan to drag on needs to have a transparent background so that the previous view is still visible. I tried using a swipe gesture paired with an animation that brings in the view from the bottom, but the previous view turns black momentarily before the animation is complete. Also, it doesn't follow the finger's path. This is similar to what happens when you try drag from the bottom of the camera app. It brings up a page, following your finger, and darkening the background. I am doing this programmatically. Thanks.
To do this you will need to use a UIPageViewController and set its transition style to scroll and navigation to vertical. There are lot's of great tutorials on how to use a UIPageViewController so just look online.

Add a Label to the bottom of a webview

I am trying to add a label to a webview, the label looks like a button and sticks to the bottom of the screen, it transitions to a different view on tap.
Tried adding a tab bar to the webview but the webview does not show the tab bar at all.
Any suggestions on how this can be achieved will be highly appreciated. The link below shows the green label at the bottom of the webview. I am trying to add a similar label on my webview but so far no luck.
http://imgur.com/e0fsy6e
Don't add label to webView. WebView is responsible for drawing its content. Add over subviews above webView, e.g. to webView's superview. Especially if you need to move it to over view later.
Also, want to mention that in provided design I would use UIButton instead of UILabel for "RESERVE CLASS" element.
And pay attention to AutoLayout and LayoutConstraints.

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!

How to show UIButtons present on the view controller

I had a UIViewController on whose view I had started an AVCaptureSession and added two UIButtons to capture photos and close the camera,
I was facing the issue that the AVCaptureSession was also getting rotated when I was rotating the device,
To solve the problem I followed the second answer on this link,
<https://stackoverflow.com/questions/7353789/ios-disable-autorotation-for-a-subview>
But after adding on the window if I am making the view on the window of the full width and height as the self.view I am not being able to see the buttons
Any suggestions how I can bring the buttons visible while adding the window view as full width and height as the view of my view controller.
You will probably have to create a subView of the "full width and height" view that you have created, and put the buttons over there (instead of in self.view).
Edit:
You might also try calling bringSubViewToFront on both buttons.

UIPickerView modal with already visible toolbar attached

(See Sketch)
How would I implement this behaviour with an already visible toolbar? Also, the little information I found on opening a UIPicker modal are all based on using a UITextField which is not what I'm aiming for.
What I'm looking for is a button on the toolbar opening the picker modal with the toolbar attached to it. Button1 on the sketch is simply to select a value the user is most likely to pick (Something like "Go to todays date"), and done should hide the modal and bring the toolbar back to it's original state of being attached to the bottom of the screen.
Ideally, I'd like this toolbar with the picker functionality to be avaiable on multiple views.
You could add constraints to your storyboard, connect them as outlets to your code and then disable and enable the appropriate ones whenever needed.
One constraint setup would be:
add a constraint that pins the top of the picker to the bottom of the view
add another constraint pinning the bottom of the picker to the bottom of the view
-> If you enable 1 and disable 2, the picker is hidden
-> If you enable 2 and disable 1, the picker is visible
That change in constraints is animateable which will result in a smooth UI change.

Resources