prevent uicollectionview section starting on new line [duplicate] - ios

This question already has answers here:
UICollectionView remove section breaks with UICollectionViewFlowLayout
(2 answers)
Closed 5 years ago.
I'm using a flow layout on uicollectionview. It all looks great except it seems to start another section on another line. This seems like a sensible default but how do I override this and make the sections flow seamlessly on the same line as if no new section began?
Thanks!

There is a library I found which has this as one of its features
RDHCollectionViewGridLayout
https://github.com/rhodgkins/RDHCollectionViewGridLayout

Related

Two different UITableViewCells with same xib [duplicate]

This question already has an answer here:
One xib, several sub classes
(1 answer)
Closed 4 years ago.
I have two UITableViewCells that looks exactly the same, but each one has a completely different logic.
So I want to create two UITableViewCell, with the same xib.
The logic of each cell is different and I don't want to have code split with ifs.
How do I do that?
If its a same UI than you shouldn't create two UITableViewCell.
What you can do it write two different updateView method in a same uitableview class.
This way you can reuse the code and also if there is design change you just need to change in one place

How to have different elements in collection view? [duplicate]

This question already has answers here:
Displaying two different cells in a collection view - Swift 2.0 iOS
(2 answers)
Closed 5 years ago.
so I try to have collection view but been thinking is it possible to have different element in each cell view? For Example: in the first cell I have the whole cell covered by UIImageView while some specific cells only got UITextView.
Here's an example that I'm talking about, Medium iOS App.
Create several prototype cells, each formatted with whichever UI elements you want, and dequeue the appropriate cell for each different type of data you want to display.

Making a single Prototype UITableCell for use with multiple controllers [duplicate]

This question already has answers here:
In a storyboard, how do I make a custom cell for use with multiple controllers?
(7 answers)
Closed 6 years ago.
This post explains why a single Storyboard prototype UITableCell cannot be used for multiple Views:
In a storyboard, how do I make a custom cell for use with multiple controllers?
However, that was for Objective-C in 2012. Is it still true now for Swift, and if not how is it achieved please? Thank you.
Yes it is still true. It's in a limitation of the application frameworks, not of the language. That said, it is possible to register a nib file that defines a cell and share it across multiple view controllers

How to create custom animation in iOS [duplicate]

This question already has answers here:
How can I animate the movement of a view or image along a curved path?
(4 answers)
Closed 9 years ago.
I want to create an animation using UIView's animateWithDuration, but I want to set a custom path rather than having it just go straight across. Is there any way that this can be accomplished without using multiple animations?
Thanks
I think the best way to solve this is to use core animation instead of basic UIView animation. It provides the flexibility you're looking for but is a bit more involved.
Here is a similar question which has been answered.
Here is another tutorial to do the same.

Collapse sections in Objective-c [duplicate]

This question already has answers here:
Expand/collapse section in UITableView in iOS
(17 answers)
Closed 9 years ago.
I am doing an application form in my app and I want to make something creative, so I thought of having the form components in sections (like the following images), and do a collapse and expand affect on them.
Is there is any class or something which could help me implementing this or I have to do it manually?
I used to take advantage of a UITableView and the methods
- (void)insertRowsAtIndexPaths:(NSArray *)indexPaths
withRowAnimation:(UITableViewRowAnimation)animation
and
- (void)deleteRowsAtIndexPaths:(NSArray *)indexPaths
withRowAnimation:(UITableViewRowAnimation)animation
to simulate and expand/collapse behaviour.
Refer to the documentation for more details.
I've used then selectable section headers (either via UIButton or gesture recognizers) to let the user expand/collapse.
There are also a lot of tutorials out there that are quite explanatory, using different techniques:
Collapsable Table View for iOS
Expandable/Collapsible Table For iOS
Finally you can take a look to this control that should provide the functionality that you are searching for:
UIExpandableTableView

Resources