How would one go about implementing the stock iOS emoji keyboard programmatically? - ios

It seems there's two main sections:
Let's call them emojiCollection and bottomBar. bottomBar seems simple enough, a UIStackView that's horizontal, that contains a back to main keyboard button, backspace, and a bunch of categories in the middle.
emojiCollection is trickier for me to understand, and my questions are:
1) how would one have "sections" of emojis, where there is a title at the top that remains in place until you get to the next section. Is this all just one UICollectionView?
2) How would you go about highlighting the section in bottomBar to identify which section you're in.
3) Seeing that it's horizontal and extends past the screen, would it be placed in a UIView that has some width proportional to the amount of rows, or would it automatically keep growing?
EDIT: To answer Losiowaty's question, this is how I would like to build it:

Related

xcode 7.3 swift What UI views make up the structure of this display?

I'm trying to figure out the structure of this iphone app display, but for the life of me I can't work out a convincing structure. I think my understanding of Nav Bars, Views, Toolbars, maybe embedded toolbars, icons, etc is just too weak to figure this layout out.
I've read endless Apple doc, and net tutorials, but none of them address things as pretty (and complex?) as this layout, simple as it looks.
I've spent hours trying to build a stack view for the top bar, with two left/right icon buttons, with an embedded toolbar (+ 3 bar button items) in the middle. But with zero success -- I posted a separate question on why my embedded toolbar with 3 buttons disappears in the stack view with distribution=Fill Proportionately.
Could anyone give me a convincing layout structure that I can try? And how about the dark blue color, with a sunken border around the 3 center buttons, and a darker background for the selected button? (Is the selected button a separate image from it's unselected state?)
And then the second collection -- is it a view with rounded corners behind the controls, or is it something else? How might I space out the left/right arrows with the long date string button in the middle (not with a horizontal stack view, I'm guessing). And the bottom buttons -- could that be a segmented control?
If you could identify the building blocks for me, that would help. Or maybe a tutorial or doc somewhere, or a code project example somewhere that I could study? (Wouldn't it be wonderful if someone had a sample app with this stuff that I could just load and learn from... :-) PS. I've also looked around the net for sample open source apps, and found probably 50, but none that I could recognize as being on target, or in swift.
Many thanks in advance.
The top area is probably a UINavigationBar, and the three things in it are its left bar button item, its title view, and its right bar button item.
The bottom part is a UITableView in Grouped style. It has two sections. The first section consists of one cell in which is laid out the whole four-subview structure. Then there's another section whose header title is "today" and each of the things after that is a cell.
The two "make a choice" rectangles, both at the top and in the first cell, are UISegmentedControls.

ios 8 layout using uitableview static cell & uitableview dynamic prototypes

I work on a app, nothing fancy, but since is my first app, there alot of stuff I never did before.
So, I'm trying to build a view like the image attached.
I've looked up on the Internet how to do something like that but I don't know what is better/cleaner way to do.
As you can see I have 3 areas: the title, the tableview in the middle and a button on the lower side.
The table will expand based on the content (3 lines or 30 lines) so the button must move down and a scroll bar should appear.
So, my idea:
Using a tableview having 3 static cells: one to put my title, second to put a tableview having prototypes cells, and a third one for the button.
That way I would have a scroll bar when the table in the middle grows, pushing the button.
Here I have a question: how to have the table view (the inner tableview) resize itself, pushing the height of the middle row, instead of having a fixed width with a scroll.
Is the the best way to achieve that?
Thanks for any idea.
C.C.
Are you sure you want to push the bottom UI down as the table grows? You say whether the table has 3 or 30 cells, but what if it has 300 cells? Your user then has to scroll to the bottom to reach the button and tab bar. I think you'll find that it would be better to use Auto Layout and let the table fill the screen space between the title and the button. The table will scroll so if you have 300 cells then you can scroll through inside the table's available area.
The advantage here is you won't be fighting with Auto Layout. If your user rotates an iPhone 4S into landscape you'll only have a few rows displayed but conversely if they run in portrait on an iPad you'll fill all of that space.
As for how to do it, the other advantage is that you don't need the nested table you describe. Use a constraint to attach the title label to the top layout guide, then attach the tab bar to the bottom layout guide. Put a vertical space constraint between the button and the tab bar. Finally, put vertical space constraints between the table and the title & the table and the button. (You'll need to implement constraints for the horizontal axis as well, but that's pretty simple.)
There's are refinements you can put into place if you want the table to shrink to fit if there are only 3 rows, but this should get you started and you may not want that anyway.
Key point: the tableView wants to scroll naturally, inside a view sized to fit the display. Don't change that behavior unless you really have to. Neither your users nor UIKit expects what you're trying to do, and the table is going to fight you all the way about it.
Nesting UIScrollViews (which your nested table would do) works, but it opens up a lot of bad UI flow problems. In my experience every time somebody wants nested scrollViews there's some other approach which is more "natural" to iOS interface paradigms.
If you're dead set on the UI you described I wouldn't use a table for the outer structure. Just make it a UIScrollView and calculate your content size based on the number of rows the table will display. You can actually do that, and then use Auto Layout as I described.

Main Menu Button Grid iOS

There are plenty of good grid-of-button controls out there (such as GMGridView) and tutorials around UICollectionView (here).
However, they all seem to focus on imitating the look and feel of the Springboard of Photos app.
I'm looking for something that is more like the main menu you might see in a game. Where if I had one button, I want it to fill my view and be centered. Two buttons I would expect to share the space. Five buttons would have either a button on top (or below) a box of four buttons centered.
Is this sort of dynamic sizing of buttons to fill its parent container and centered of controls into columns easily accomplished with UICollectionView or would it be better to head down the path of something custom where I have a fixed layout support for, say, 1 - 5 button configurations.

UITableview blocking uiview

So I had a UITableView that I tried to make smaller by adjusting its constraints. I then added three labels and textfields to my UIView. However, upon running the app the UITableView doesn't seem to have been made smaller, instead it's "overlapping" my labels and textfields. Here is a picture of what I am describing. http://imgur.com/BoC6l1R. And here is a picture of the storyboard editor. Note the dotted lines. http://imgur.com/wUyccDk. I've tried changing many things with the constraints but they all make everything more messed up. I feel like the solution should be pretty simple. Thanks!
In the second image (the storyboard) you see there's a dotted line and a yellow line with +78. That indicated that the constraint specifies that the table view should be 78 points above where it is now. That's a warning in your storyboard meaning that the UITableView will appear in a different position at runtime.
The easiest way to solve it is to open the storyboard file, then at your left there should be the Document Outline. Find your view controller, and there should be a small yellow arrow next to the view controller name. Click on it and you'll go to a screen showing you the constraint warnings. It should say "Misplaced views". Click on the small yellow arrow next to the misplaced view (your UITableView) and a popup will appear. Select "Update Constraints" and then click on "Fix misplacement". That should do it.
However, a better way to solve it is to put a constraint between your text fields and the UITableView. Delete the constraint between the table view and the top layout guide (the one appearing yellow), then add a Vertical Spacing constraint between the UITableView and the UITextField below the Sea_State label.

UIViewController with UITableView and TextField storyboard placement

This might be a simple question but using storyboard I can't seem to position my table, a message field and a button correctly. In the picture below, if it's positioned that way, only then do I get to see the text field and button at the bottom of the screen and the table view takes up the rest of the screen. If I drag the text field and button to the bottom and resize the table, the text field and button disappear and the table is cut off. Why is that? Is there a solution to this without doing it programmatically?
Easy solution is to remove all constraints then position them where you want them.
You'll find you get different effect when try to reposition items depending where you drag from for example double tap an item and nudge it with arrow keys or grab the middle to move it resizing via the corners.
But in my opinion it's easier remove all constraints from the view and then set them as you go.
Also you might want to consider using a container view for the table view and have a separate UItableViewController that way you can easily separate out that the tableview logic from the other ViewController. It will help stop things getting a little messy later on as project grows.

Resources