how to implement a searchbar above the keyboard - ios

sorry i'm still getting into swift, and i'm building an app with a search-for-keywords feature, but i couldn't figure it out how to implement a search bar above a keyboard like the picture below:
this picture is from an app called "Developer"
i'm thinking of that adding a toolbar with searchbar inside to the keyboard might be a solution, is there any other ways to make this thing works?
sorry for my bad english....

Related

UITableView: Can't find a way to move/align the tableIndex element up

I have a UITableView and I am using a tableIndex, my problem is that when the keyboard comes up, it partially hides the tableIndex.
An acceptable solution would be to move the tableIndex up (like what the Contacts App does) when the keyboard appears, and show the most of it, but can figure out a way to do this. Any ideas of code snippet I can try?
The way to do this is to register to Keyboard Will Show notification and then update the height of your controller's view. You could also embed everything in a scroll View so that once the keyboard rises, your view becomes smaller and scrollable.
It is honestly a bit annoying to set up, so, if you are open to using CocoaPods then IQKeyboardManager is probably your best bet which can be found here: https://github.com/hackiftekhar/IQKeyboardManager

Popover from UI Button to display Text

I'm attempting to make a Popover similar to the one seen here : http://i.imgur.com/wDNOo44.png
This popover is meant to be an IBAction from the button, which in this image is titled: "Ventral Primary Ramus". I've looked around the internet for tutorials and I have mainly seen tutorials on creating popovers from the UIBarButtonItem. For this popover as you can see I need to be able to title it, as well as in then display text information about the structure who's button was pressed. Along those same lines how would I go about making sure that the window will auto-fit to the text?
There is many tutorials for this. For example:
appcoda
raywenderlich
It's really easy to present some popover, just read this.

How to make an Instagram-like error label

So, I have been banging my head against a wall trying to figure out a way to accomplish this. My goal is to have an error label that appears when a username/password is entered incorrectly, but I want something different than just unhiding a label with red text (which is what I currently have). If you use Instagram, I am trying to get a label to show up like when you enter your password correctly and the label gets pushed (slid) down from under the navigation bar.
So far I have tried creating a label programatically and moving it, but the label always starts under the navigation bar so it doesn't seem to "slide" like in Instagram. I have also tried to create a new VC with a clear background and just the label and present it with a segue but that didn't work either.
If anyone can let me know how this is done, I would be very grateful.
Thanks,
Brandon
Check out YRDropdownView. It is a library, with which you can easily create notifications very similar to those used by Instagram.
http://buildinternet.com/2012/02/yrdropdownview-a-polite-uialertview-alternative-for-ios/

iOS: Add an image to the Navigation bar

I'm currently working on an iOS app that is pretty much supposed look and work like an already existing android app.
As a part of that, I'd like to make the top navigation look the same, but since iOs devices do not provide a hardware or software integrated back button, I'd also like to keep the back button navigation that's common to iOs apps.
I've tried numerous attempts to achieve it, but I'll stick with the latest I'm working on since it looks the most promising. I've started to work on a custom UINavigationBar class that overrides the initWithCoder: and layoutSubviews: methods. The result is as follows:
As you can see, the back button now overlaps the application icon. What I'm looking for is a way to make the button and the text to scale into the space right of the application icon. I've tried to handle this in layoutSubviews: but the superclass logic appears to be rather complex, I was not able to reproduce it's functionality (in particular it seems to be working with some private variables I don't have access to).
I also tried manipulating self.frame before calling [super layoutSubviews] but apart from endless loops I was not able to achieve anything in that direction.
I'd be happy if anyone could point me into the right direction.
If I understand your problem correctly, I think you could do this by adding a custom titleView to the UINavigationItem, and have an image view (on the left side for the icon) and a label (for the title) as subviews. This would replace the default title.

Trying to mimic the Apple iPad popover style

My sincere apologies if this question has been asked, but I really couldn't find it.
Essentially, I am trying to mimic the look of the popovers used by the built-in Apple applications. In particular, not the popovers that use a tableview list, but rather those popovers that only have buttons inside.
For example, in the Mail app, clicking the left-facing arrow on the top right of the screen, a popover is shown with four buttons: Reply, Reply All, Forward, Print.
How is this particular popup created to give that look?
I have tried making my own UIViewController with a black background and Round Rect Buttons, but it doesn't look the same. Any help would be much appreciated!
Thank you.
It's a UIActionSheet. On iPad, it gets a "popover" appearance if it's not presented from within another popover.

Resources