UISearchBar implementation Like Instagram IOS7 - ios7

Hello i am trying to implement a uitabbarview defined only for search. Ideally i want to implement the exact same style that instagram does Not the suggestions but the actual search bar and the tab controls to switch between the users and hashtags. I've been researching online and haven't found anyone with my exact problem. Any help would be appreciated. Disregard the device and all and just focus on the searchable with the two segmented tabs. i want something exactly like this and ill handle all the search and results etc.

What you will need to find info on is the UISearchBar and especially the UISearchBar delegate method called shouldChangeTextInRange
Find out more about UISearchBar and its delegate methods here
Helpful tutorial here (Filters the UItableView result as you type)

Related

Create a Mention friend in iOS with Objective-C

still learning iOS development, want to create something like mention friend likes in Facebook / Instagram.
Mention People UI in Instagram
Is it using new TableViewController and add subview to the same View Controller? (in this case, CommentViewController) , but, when i already have UITAbleViewController in my CommentViewController, how can i handle the second tableviewcontroller?
Looking at the image you provided it looks as though the best way to implement this would be a UIViewController that has a UITableView added to it. Each tableview that is created can have a delegate and datasource set for it. When the textview detects that a mention is being entered (more about detecting this later) you would trigger a second tableview to appear as an additional view (subview) that overlays your current tableview (or as the accessory view of the keyboard, the way apple and others present a textview over the keyboard for text entry ex: messages app).
In order to manage the two tableviews my suggestion would be to create two additional classes each of which conform to the UITableViewDelegate and UITableViewData source. The first one would be the CommentsTableViewManager and the second would be the MentionsTableViewManager. The first tableview would set the CommentsTableViewManager as its delegate and datasource while the second would use the MentionsTableViewManager.
The other problem you may run into later on is determining how to properly detect mentions being typed into the textview. I've actually created an open source library that will help you with this problem. It's located here: https://github.com/szweier/SZMentionsSwift the README should provide enough information for you to get started if you choose to use it.
I hope the information about helps get you started with your app.
From architecture prospective it's way better to have a single table view with altered data source container, depending on current mode.
Speaking an instagram way - either you're showing comments, or, if # symbol was detected, displaying a list of users. So almost all your UITableView's delegate and data source methods will start with something like if (isMentionMode) and you'll choose specific cell class/cell's height/amount of rows per section/etc depends on isMentionMode state.

Add Dropdown Menu to NSSearchField in OS X

Could someone please show or explain me how to implement a dropdown menu/ filter options to NSSearchField in Objective-C.
My scenario is I have a NSSearchField and a NSTableView on nib. I would like to search Animals|Birds|Reptiles categories.
My NSTableview is connected to NSArray that displays these items and I have done the predicate to filter out to the corresponding search string and it all works fine.
I would like add these categories (Animals, Birds, Reptiles) next to the Magnifying glass icon on the NSSearchField so the user could select from it.
I did download Apple's sample of iSpend demo app but I can't figure it out how they implement it.
never mind I found the solution by adding a nsmenu to searchfield:
Apple's Searchfield Example

Fixed searchbar like contacts

http://s7.postimg.org/suz457l23/IMG_0092.png
I want to use a UISearchBar that doesn't move, like in Apple's Contacts app. I also want to these components at the same depth, and I don't want the search bar in the tableview header.
UINavigationBar
UISearchBar
UITableView
When I try to attach UISearchBar below UINavigationBar in storyboard, interface builder doesn't show me suitable guideline. The guideline only generates when in tableview.
Is there no way to attach the search bar below UINavigationBar without programming?
I'm also searching an elegant way to build the search bar..
What I have now is a UINavigationController, inside which I have a UIViewController.
This UIViewController contains UISearchBar and UITableView. You can program the search bar on top and tableView below it.
vborra's link also helps.
It is easy to do what you are looking for, UISearchBar is somewhat meant for this. See the tutorial Here: http://www.appcoda.com/search-bar-tutorial-ios7/

Handle clicks in table view cell

Im new to IOS developing and i would like, as one of my start projects to learn more about table views. I would like to fill a table view up and then be able to handle clicks on them, to open a webpage etc. Does someone know a good tutorial or code for this?
Thanks!
What you want is the UITableViewDelegate documentation.
Specifically, tableView:didSelectRowAtIndexPath:. You can then lookup the cell at the given indexPath and handle it accordingly. More info on delegation can be found in the docs if you need it, but you'll want to implement methods like that in the object referenced as the delegate of your tableView

XCode 4. Keyboard doesn't hide on iPad

I have a problem with my iPad app.
I perform authorization in social networks (facebook, twitter etc.) to post information from app. Several webviews change each other (login, content of post, captcha). They have text fields and I have to show keyboard. After posting I return to some start view with posted information.
It works good, but after posting first news something goes wrong. When I post news one more time, after return keyboard is still on the screen.
I saw here some questions familiar to this, but they wasn't useful.
I tried to make resignFirstRersponder to all webViews, textFields and textViews. Also i\I tried to implement method disablesAutomaticKeyboardDismissal but it doesn't help me.
I don't know where search for problem...
So questions are: why could this happened? How can I solve this? fnd How can I get some information about keyboard? (is it visible, what object has focus etc., anything that could be useful to solve problem)
And one more thing. I have similar app for iPhone and it seems to work correct.
Try this:
[searchBar performSelector:#selector(resignFirstResponder) withObject:nil afterDelay:0.1];
Make sure to replace searchBar with the object that is the actual First responder in your case
Problem is fixed, finally. The reason was the way I had changed visible view. I set a new value to view property of ViewController. And as previous view contains text field with focus on it, focus wasn't lost before changing view (and keyboard was still on the screen), but I had lost handler to previous view.
Solution is: resignFirstResponder to all (or current) inputs BEFORE changing view.
Hope, it's clear. Thanks for your help!