iOS: iMessage style header and divider UI - ios

I'm trying to recreate pieces of the iMessage UI. Specifically the top buttons and dividers (i.e. "iMessage" label + line)
I'm assuming:
The top buttons are within custom UIView as the header of a UITableView
The divider is a custom UITableViewCell with a centered label and some kind of repeated background imageā€¦
Can anyone confirm or elaborate on this? Specifically the dividers.

First, I would create the divider and the "iMessage" text as a single image.
Since the divider and the buttons on top of it is "non-sticky" I would just create a custom UITableViewCell and put everything (buttons and divider image) in the table cell.

Related

How to align labels in custom UITableViewCells?

I like to use the built-in cell styles (right detail, basic, subtitle) as much as possible, but some times I need custom controls, like a UISwitch or a UIStepper to be added to the cell, and I have to create my own custom cell styles on Storyboard.
Since iOS 13 and 14 suggests using the cell's imageView is a good idea to be used for adding icons to the rows, I use it on cells with built-in styles. It seems the image view doesn't have a fixed width and the table view adapts itself to the widest image.
What should I use to tie my UITextLabels on my custom cells to in order to make advantage of this behavior? When I tie the left side of the label to the left margin, then the label overlaps the imageView.

UICollectionViewCell Shadow on all four sides

I was wondering want the best way to add drop shadows to a set of collectionviewcells that do not have spaces between them?
Background
Part of my layout has various cells positioned across the screen like a post. It notes and the second half of the layout is structured to look like a tableview except all the cells don't go to the edges there's a bit of padding. So I can't really add a shadow around the collection view itself.
I have added shadows to the cells in the post. It note part which works great because the cells have spaces between them but I'm now struggling with the second half (the tableview looking part) because obviously when you add the shadows to the cells depending on the zIndex you may see the shadow overlapping the below or top cell.
So I was wondering what is the best way to do this?
Should the shadows decoration views underneath the cells?
OR
Should the shadows be attached to the cell and increase the ZIndex for each cell so they appear on different levels hiding the shadow - but that leads to a question on how to do the first cell and have a top shadow?
OR
Should I almost fake it by using an image of a shadow inside the cell itself?
I also have deletion functionality so I need to figure out how to make sure if I delete the first cell, the second cell should then have the top shadow in a nice animated way.
EDIT:
I am trying to create the following view inside the collection view. I have got the layout correct. 1
The green lines are the shadows I have working but the red are the ones I'm having trouble with and the boxes are the different cells.

Is there a way to combine two UI elements?

I am developing a mobile app in Swift and I have a custom UIView that displays a circular progress bar, but I want to add a UILabel in the middle that also displays the progress percentage. Is there a way to do this?
UIViews can overlap. You can just put the label on top of your custom view, or you can make the label a subview of your custom view.

Need assistance regarding custom UITableView and custom UITableViewCell

This is screenshot of whatsapp, I have to create a tableview just like this one.
It has space on left side (Dont know top two cell are custom or default with right detail style).
Few cells in between have no separators.
How I am suppose to do same with my uitableview.
Start from iOS 7 left inset of UITalbeViewCell is default. Default value is 15, but you can change it.
This is not a few cells. This is One custom cell. I mean work+main+iPhone it is one cell.

Trying to mask a UIImage to display UITableViewCell contents behind it while scrolling UITableView in iOS

I am building an application where I have a ruler (that is a UIImage) that I use to scroll a UITableView. My UITableView has UILabels on each cell that display text. When the user leaves the ruler over a cell, the ruler has on it a UILabel that displays the contents of the UITableViewCell that it is over top of. All of this functionality is in place, and is working fine.
What I would like to do is when I scroll the ruler up or down, is to be able to view the contents of the table rows behind it dynamically while "the ruler is moving", so that the user can see right through the ruler. As a concept, I realize that this technique is called "masking", but normally "masking" is done using two images. What I'm trying to do is use a UIImage that has a UILabel on top of it, to display the contents of the rows behind it while it is moving. Can anyone show me how to do this, or point me in the right direction?
Here is an image of what it is I am trying to implement:
If you look at the image that I am using, the ruler image is partially hiding the bottom of the text in the third row, and partially hiding the top of the text in the fourth row. I would like the ruler to display the bottom of the text in row 3, and the top of the text in row 4 rather than hiding it when it is in this transition state.

Resources