Handling multiple Xib or fixing collapse and expand button on multiple Xib file - ios

Now the situation is illustrated in this image:
I have an app having multiple Xib files calling in one main Xib and its class. I have added expand and collapse view which works on particular xib expand and collapse subviews as required and reduces/Expands Height too.
This works well for one xib section when all tabs of xib files are collapsed and the second xib won't change its y-coordinates, but I'm having a white space between. I want to fix it.
Note: Every xib contains a class referring to it. The whole app won't use auto-resize.
How can I solve this?

Related

Not able to add footerView in UTableView through XIB

I am trying to add FooterView(UIView) by dragging down on UITableview through XIB but can't.
Yes we can add it programetically (tableView.tableFooterView = myView) & also works with dragging view in Storyboard,
But I want right from XIB.
You cannot do this in a Xib. If you think about it, a storyboard is somewhat like a collection of Xib files. Thus, in a storyboard you can add a footer view as a kind of 'xib' embedded in that storyboard. A pure xib cannot contain multiple child xib's, so what you want is not possible unfortunately.

How to attach Xib at the bottom of tableview

I would like to attach a nib file with custom buttons and textfields at the bottom of a tableview. When i scroll the table and it reaches the last cell it must just continues to the attached nib without stopping scrolling. I want to achieve the same action as if its a footer on the tableview. How do i achieve such in objective c. An example or a pointer to a tutorial will be helpful.
This is a good article that I had used a while ago to be able to use Xib files in storyboards:
https://medium.com/zenchef-tech-and-product/how-to-visualize-reusable-xibs-in-storyboards-using-ibdesignable-c0488c7f525d

iOS different default margins

I'm designing my views both with a storyboard, and in a few .xib files for views that I instantiate programmatically. I also have some UITableViews, added from the storyboard.
I'd like to have consistent margins across my views. For now I have 3 different values:
a value for my table views
a value for the views I designed in my storyboard
a value for the views I designed in a .xib file
Here is a screenshot showing the problem (left: .xib view, middle: table view, right: storyboard view):
In the GUI builder, I always check the "Constrain to margins" checkbox, so that the margins are different depending on the device (which is nice). Having a different value for the table views is no big deal, but having different values depending on the way I designed the view (.xib vs storyboard) is really annoying.
Is there any way to have the same value everywhere, or at least in .xib and storyboard views?

How can I use a xib with auto layout in iCarousel?

I have an iCarousel set up to reuse a certain xib. This xib is using AutoLayout (as I am in the rest of my project). Apparently iCarousel does not use AutoLayout, and it does not work correctly with it. The view's constraints appear to be calculated for another frame, and then the view seems to resize...
I have an example project showing my setup here
Here are some images of my troubles:
The first view is correct:
The second and all the others screw up in another way:

Why there is no prototypeCell in View.xib?

When we add any UITableView to UIViewController through storyboard we will see screen like this
and there is an option for PrototypeCell top right side. But when we add the UITableView to View.xib we will see screen like this
and here there is no PrototypeCell. I am not understanding this why there is difference. Please explain.
It's different because when you drag and drop a UItbaleViewController in the UIStoryboard, it assume that you will use dynamic cells, and when you drag and dropped a simple UITableView it changed the property to static, which means that you will provide different UI and informations to each cells.
You can change the style to dynamic instead of plain if you want to have prototype cells.
PrototypeCell not available in xib file, storyboard only.
You can use separated xib for UITableViewCell in this case. (in storyboard case you also can use separated xib for cells)

Resources