Customize cell layouts programmatically - ios

I followed a tutorial on how to make a UICollectionView and my cells looked like this:
My question is how can I customize them as I want? By code, since I want to do everything with code, I would appreciate any help, links, or anything to understand everything about how to customize items and cells.

Related

How can I add a tableViewCell within another TableViewCell?

I need to implement a cell inside of another cell, is it possible in any way? Or should I just find another way? thanks
Edit:
Sorry for the brief description, the problem here is that I've got a component thats a cell, and I want to include it in a tableview with some other icons and labels in the cell. Maybe the best solution here would be to include a tableview inside of the cells, with a unique cell in it, as someone suggested. I've tried to do it and it worked but when it came to launch another screen when selecting the cell it only worked on the margin where the inside tableview isn't included, how could this be solved?
something like this
Thanks!
Find another way. I don't know what exactly you want to do, but maybe modify the headerView for your section (kind of like a cell) and use the cells within that section as your sub-cells.
As it’s been stated above, I would strongly suggest finding another way. Without knowing more details about what exactly it is you’re trying to accomplish, it’s hard to give you another solution but I ran into something similar last year. It’s gets extremely messy and it does not scale well, especially when using a lot of dynamic data. Also, when using UIKit, I think there is a limitation of having a dynamic table cell inside another table cell, which limits your use cases dramatically. If you provide some more details on what it is you’re trying to accomplish, perhaps we can point you towards a better solution.

How i can use multiple nib files with multiple arrays?

I am creating my iOS app, and i during that , now i have to build scrollable screen where there is image view, labels, collection view, Reviews etc (Prototype Image is attached). I am wondering is it possible to make that type of screen with UITable view using multiple Nib files? (If it is possible, kindly guide me as how i should use multiple Nib files with multiple arrays). And , if it is not possible, how else i can go for it? Kindly guide me, and sorry if thats a duplicate because i have searched but i was not able to find any good answer.
There are several approaches that you can do.
If you want to use UItableview, then you need to create multiple
UITableviewCells, where each cells is based on the section of the design. Then you can load it by using array, as you logic stated above. For example indexpath[0] you'll load the cell with the picture(lets call this pictureCell), then indexpath[1] you'll load descriptionCell, and so on.
The other approach is using Scrollview, with several UIViews on a vertical stackview. And then you'll create a UIView Subclass based on the section of the design. This is usually my go to solution.
I'm not sure what "array" is refering to here, but by the look of your screenshot, I would go with a StackView inside a UIScrollView, or something like that. No need for a UITableView if you don't have a repeting pattern, you can just stack multiple views in a scroll view.
I hope it's clear enough.

How to make a simple TableView?

I've been searching and trying stuff for like 4 hours and I can't get to make a simple TableView in iOS. Just like every app does..
Examples:
I want to achieve something like dropbox does, just to have a login..
The last thing I tried and was the closest was to add a TableViewController, then a TableView inside it and then 2 TableViewCells inside it, but then when I add the elements in the Cells they just don't appear in the phone !!
Also I can't get to make a "padding" just like dropbox does, I think that maybe that is not a TableView, is it?
I am just a bit confused.. I watched 3 different videos but they are outdated, also the doc is..
In your storyboard change the content property of your table view from "dynamic prototype" to "Static cells"

Possible ways to do like UITableView Design with multiple columns.?

I have gone through many of sites. But I didn't get the way to achieve it .
As so far , I came to know that using UITableView we need to make custom cell with some stuff of code and lots of stuffs on some custom design like GridView etc
https://github.com/tanin47/UIGridView [Here it is ok to modify but I'm actually looking for within 1 class file].
.
Here is actually I need to look to do design as like below image .
Here, I have done so far by using THIS LINK. but it is not useful for me.
if anyone knows please share your thought , any help or suggestion should be appreciable.
You can create a your own Custom UITableViewCell and design it in such a way it contains multiple UIButtons arranged Horizontally and seperated by seperators image . Here each UIButton will be representing a seperate column and also different selector methods must be added as target for different buttons within the cell . The UIButtons that are vertically aligned in different rows must have the similar Selector. In order to differentiate between buttons you can set their tag as the indexPath.row for the respective row .
I hope this might solve your problem :)
If you are looking for a grid like view you could very well use a UICollectionView and do some tweaking with design.

implementing uitabbar to uitableview

I want to put a uitabbar into a section in uitableview, I have hard time looking a way for it, since I just started doing XCODE in less than a month. Anyone there know the solution for it? Any help is appreciated, and if possible, could you share a link for the tutorial or examples as well. Thanx in advance.
You can't do it in this way. They both are different things but you can have UITableView inside the uitabbar view. But vica-versa is not allowed ...this is not feasible and also not proper as per apple's guideline. So, please make sure not to use in this way...rather go for some other alternative :
like put Custom UIToolBar in header of tableView , having look & feels like Tabbar.
You cannot put a tab bar into a tableview.
I you want to use a tab bar, use it as a sub view of a UIView.
The UITabBar is supposed to contain other views. So no, you cannot add it to your table view. To get the look and feel of the Groupon app, there are two things you could do:
1. Create a custom tableviecell as advised above.
2. Since the toolbar (which looks like a tabbar) is outside the actual table, you can have it as a separate view and reduce the size of the table to accommodate it. Or add the toolbar to the footer view of the table.

Resources