Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compatible with UISearchDisplayController #35

Closed
futuretap opened this issue May 23, 2014 · 3 comments
Closed

Not compatible with UISearchDisplayController #35

futuretap opened this issue May 23, 2014 · 3 comments

Comments

@futuretap
Copy link

When the returnToRefererView is shown in a setup with a UINavigationController containing a UITableViewController with a searchBar on top, there are a couple of issues:

  • the searchBar can't be scrolled in completely. It's only shown by 10 pt or so, the rest is covered by the navigation bar. It looks like the contentInsets are wrong.
  • when I actually manage to tap that small part of the searchBar to activate UISearchDisplayController, the searchBar is almost completely covered by the returnToRefererView.
  • When search mode is ended, the returnToRefererView is not shown anymore. It is displayed again when search is activated again.
  • when returnToRefererView is closed while search is active, the searchBar moves down not up and reveals an empty gap where the returnToRefererView was before.

To me it looks like it's not a good idea to mess with the navigationBar position!

@james075
Copy link

james075 commented Jul 8, 2014

I got the same issue and have tried to fix it by getting into BFAppLinkReturnToRefererController and BFAppLinkReturnToRefererView classes but no results.

I tried to add the referrer view to the navigation.view and change its position to be visible:

- (void)viewDidLoad {
//...
    _returnToReferrerView.frame = CGRectMake(0, -44, 320, 44);
    _returnToReferrerView.delegate = self;
    [self.navigationController.view addSubview:_returnToReferrerView];
//...
}
- (void)displayReferreView {
    CGRect frame = self.navigationController.view.frame;
    frame.origin.y = 44;
    self.navigationController.view.frame = frame;
    self.navigationController.navigationBar.frame = CGRectMake(0.0, 0.0, 320.0, 44.0);
    [self.navigationController.view bringSubviewToFront:_returnToReferrerView];
}

The issue here is that label view is no more touchable, no way to interact with theses buttons.

So I back to the Bolts' solution:

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];

    if (!self.returnToRefererController) {
        // fake data
        NSURL *url = [NSURL URLWithString:BFURLWithRefererData];
        BFAppLink *appLink = [[BFURL URLWithURL:url] appLinkReferer];

        // init for display above nav controller
        self.returnToRefererController =
        [[BFAppLinkReturnToRefererController alloc] initForDisplayAboveNavController:self.navigationController];

        [self.returnToRefererController showViewForRefererAppLink:appLink];

        return;
    }
}
  • [1] after launching the app, all views are well positioned
  • [2] push a view controller then pop to the root, self.view changes origin.y automatically (even if I try to force it).
  • [3] UISearchDisplayController is active.
  • [4] present then dismiss a view controller, I got an empty view (no interaction enabled).

screen shot 2014-07-08 at 12 47 49

Do you have any ideas ?

@agener917
Copy link

With this context, I cannot figure out the entire story. You first solution should be working, but did you call "[self.returnToRefererController showViewForRefererAppLink:appLink];" ?

Here is a working sample shows the minimum steps that make it work. https://github.com/AppLinks/Samples/blob/master/iOS/PrimeNumbersSample/PrimeNumbersSampleApp/PNDefinitionViewController.m

@grantland
Copy link
Member

Closed due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants