scrollview within a containerview in storyboard not scrolling - ios

I have a viewcontroller with one UIView on the top and a containerview placed right beneath it. Like,
I'd connected everything with Autolayout.
Now, I want to load 4 different containerviews in that bottom space(one over the another, since at a time I'll show one containerview only and will hide the rest using alpha property of a UIView), of which one of the containerview has so many subcomponents(registration page comps), for which I used a UIScrollview. The scrollview is not working in this scenario, my question is,
Can I use a scrollview within a containerview?
My scrollview has a UIView in it, which inturn holds the individual components, is that the reason why my scrollview is not working?

Related

How do I make my UIView scrollable horizontally programmatically using Objective-C?

I have created nine table view controllers using page view controller and UIView. Inside UIView, there are nine buttons to points the table view controller.
My problem is, I want to make my UIView scrollable programmatically. In my project, all the buttons are in the same controller and no space to move.
Can anyone help?
My project image:
use UICollectionView and set UICollectionView.pagingEnabled = YES.
UIScrollView is the same but you need to do something for sub views and scrollView contentSize.
use HMSegmentedControl third party for same

Hide non child UIView in UIView

I want to hide a non child UIView in a UIView but I don't know how to do it.
To be specific, I have a UITableView. Each UITableViewCell has another view inside it (a wrapper view called wrapperView). The wrapper has some labels set up in IB and some created programmatically. I have created a custom slide mechanism that reveals buttons under the wrapper (like the standard one does).
The labels created programmatically don't exceed wrapper's bounds because it clips the subviews. The problem is with the labels created in IB. They are the subviews of contentView.
How can this be solved? Is there a way for a UIView to clip other views on the same level(not parents nor children)? Or "transfer" the labels to the wrapper view?
It isn't completely clear what you're asking. A view will only clip it's subviews, not views that happen to fall within their frame rectangle but aren't subviews.
If you want to move a view object from one view hierarchy to another you can use addSubview(_:) to do so. That will automatically remove it from it's current parent view. To quote the Apple docs:
Views can have only one superview. If view already has a superview and
that view is not the receiver, this method removes the previous
superview before making the receiver its new superview.

Hiding labels in iOS without breaking the view

I know we can use UIStackView in iOS9, but I'm not able to get rid of iOS8 at the moment, so I was wondering if is it possible to hide some labels inside a UIView (plain UIView, UIScrollView and UITableViewCell) and keep the rest of the visible labels "stacked".
Basically I've got some labels "stacked" vertically and pinned to each other by autolayout. If I hide any of them I get an empty space where the label was placed in interface builder.
I've managed to emulate the stackView's behavior using OAStackview, Following these steps:
Subclass ViewController using a UIScrollView and a OAStackView property.
Put the stack view inside the scroll view
Set constraints for these properties programatically
Add a bunch of custom labels to the stack view.

UITableViewController within UIContainerView

I have a static UITableViewController embedded within a UIContainerView. All created using Storyboards.
I'm setting the positioning of the container view using autolayout, whereby it is always touching the top, left and right of the uiviewcontroller it is within and always 50px from the bottom due to a UIButton being there.
The UITableViewController has a larger content size than the height of the container view, so one would expect you to be able to scroll the tableview from the container view.
But for some reason I cannot get it to work, when you initially load the UIViewController the scroll indicator appears and then hides and it won't let you scroll the tableview. How would I solve this?
(It has previously worked for me, I just can't remember what I did.)

Auto-Layout UIScrollView and an animated UIView

Currently having an issue with using auto-layout and UIScrollView. The issue is when I scroll down on the scroll view, a previous UIView (that should be free roaming, and is animated to various positions) gets set back to its initial location where it is located in Storyboard.
What's the best way to make my single UIView not follow the behavior of auto-layout and let it do whatever it wants to do?

Resources