Coder Social home page Coder Social logo

searchResult behavior about ghsidebarnav HOT 4 CLOSED

gresrun avatar gresrun commented on July 28, 2024
searchResult behavior

from ghsidebarnav.

Comments (4)

gresrun avatar gresrun commented on July 28, 2024

Antoine,

If I understand your question correctly, you would like a way to hide the search controller and present a content view controller when a search result is tapped.

This can be accomplished by implementing the GHSidebarSearchViewControllerDelegate like so:

@interface MYSearchDelegate <GHSidebarSearchViewControllerDelegate>
@property (strong, nonatomic) GHRevealViewController *revealVC;
@end 
@implementation MYSearchDelegate
@synthesize revealVC;

- (void)searchResult:(id)result selectedAtIndexPath:(NSIndexPath *)indexPath {
    self.revealVC.contentViewController = // Create view controller based on result and/or indexPath
    [self.revealVC toggleSidebar:NO duration:kGHRevealSidebarDefaultAnimationDuration];
}

- (void)searchResultsForText:(NSString *)text withScope:(NSString *)scope callback:(SearchResultsBlock)callback {
    // Your logic here
}

- (UITableViewCell *)searchResultCellForEntry:(id)entry atIndexPath:(NSIndexPath *)indexPath inTableView:(UITableView *)tableView {
    // Your logic here
}
@end 

from ghsidebarnav.

mayous avatar mayous commented on July 28, 2024

Thank you for your fast answer.

However, i tried the same thing on your demo project and it does not work, nothing really happened. I know your library is compatible just on IOS 5 and i'm running it on IOS 6. It is maybe the problem...

Edit : I tried on IOS 5 and it does not work too.

from ghsidebarnav.

gresrun avatar gresrun commented on July 28, 2024

OK, I've just spent the last few days working on this:

https://github.com/gresrun/GHSidebarNav/tree/Storyboard

It is an attempt to use storyboards as much as possible. Only works with iOS 6, as it uses the latest and greatest.

It includes some changes to the search delegate to resolve the issue you uncovered, among many other changes.

from ghsidebarnav.

mayous avatar mayous commented on July 28, 2024

It is working great and your code is cleaner.

However, I am trying to remove all reference to storyboards... so it will take me some time to create a clean project but at this time it is working great.

Thanks you

P.S : I do not understand what i need to do programmatically with all the delegate which i need to connect between the controller "GHMenuViewController" and the new helper GHSidebarSearchHelper.

from ghsidebarnav.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.