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

Multiple ContactPickers no longer working on iOS7.1 #69

Open
jlaws opened this issue Mar 20, 2014 · 8 comments
Open

Multiple ContactPickers no longer working on iOS7.1 #69

jlaws opened this issue Mar 20, 2014 · 8 comments

Comments

@jlaws
Copy link

jlaws commented Mar 20, 2014

Setup 3 contact pickers in one view, each with an initial height of 30 and with a spacing of 0. When you try and click on them, you can only select the view that is furthest back in the view hierarchy (first one in the order in a Storyboard).

When I run it on an ios 7.0 simulator, this issue is not there. Switch to the 7.1 simulator and it doesn't work.

I'll start looking through the source to figure out what changed, however if anyone else has experienced or fixed this already, please let me know.

@aout
Copy link

aout commented Apr 13, 2014

Any updates on this issue?

@mhupman
Copy link
Member

mhupman commented Apr 15, 2014

I'm unable to reproduce this issue. I placed 3 MBContactPickers on a storyboard scene and ran it in both 7.0 and 7.1 simulator. I was able to tap on all 3 and they became first responder. Can you further describe your setup or upload a demo project?

@kyosold
Copy link

kyosold commented May 8, 2014

I'm is ios 7.1, it show contacts list but i can't click it, i use it in UITableViewCell and i can see the contact list but i click it is the other UITableViewCell, it seems like isn't top,i'm use xib, code:

// ---------- MBContactPicker DataSource & Delegate --------------

  • (void)initContactPickerView
    {
    AppDelegate *app = (AppDelegate *)[[UIApplication sharedApplication] delegate];

    self.allFriendsArray = [self.myCommon getFriendsInfoWithAccount:app.sessionAccount WithType:0];

    NSMutableArray *contacts = [[NSMutableArray alloc] initWithCapacity:self.allFriendsArray.count];
    for (NSMutableDictionary *friendItem in self.allFriendsArray) {
    MBContactModel *model = [[MBContactModel alloc] init];
    model.contactTitle = [friendItem objectForKey:@"displayName"];
    model.contactSubtitle = [friendItem objectForKey:@"mailbox"];
    [contacts addObject:model];
    }
    self.contacts = contacts;

    self.contactPickerView.delegate = self;
    self.contactPickerView.datasource = self;

    self.contactPickerView.prompt = @"";
    }

  • (NSArray *)contactModelsForContactPicker:(MBContactPicker *)contactPickerView
    {
    return self.contacts;
    }

  • (NSArray *)selectedContactModelsForContactPicker:(MBContactPicker *)contactPickerView
    {
    return self.selectedContacts;
    }

  • (void)contactCollectionView:(MBContactCollectionView*)contactCollectionView didSelectContact:(id)model
    {
    NSLog(@"Did Select: %@", model.contactTitle);
    }

  • (void)contactCollectionView:(MBContactCollectionView*)contactCollectionView didAddContact:(id)model
    {
    NSLog(@"Did Add: %@", model.contactTitle);
    }

  • (void)contactCollectionView:(MBContactCollectionView*)contactCollectionView didRemoveContact:(id)model
    {
    NSLog(@"Did Remove: %@", model.contactTitle);
    }

// This delegate method is called to allow the parent view to increase the size of
// the contact picker view to show the search table view

  • (void)didShowFilteredContactsForContactPicker:(MBContactPicker*)contactPicker
    {
    if (self.contactPickerViewHeightConstraint.constant <= contactPicker.currentContentHeight)
    {
    [UIView animateWithDuration:contactPicker.animationSpeed animations:^{
    CGRect pickerRectInWindow = [self.view convertRect:contactPicker.frame fromView:nil];
    CGFloat newHeight = self.view.window.bounds.size.height - pickerRectInWindow.origin.y - contactPicker.keyboardHeight;
    self.contactPickerViewHeightConstraint.constant = newHeight;
    [self.view layoutIfNeeded];
    }];
    }
    }

// This delegate method is called to allow the parent view to decrease the size of
// the contact picker view to hide the search table view

  • (void)didHideFilteredContactsForContactPicker:(MBContactPicker*)contactPicker
    {
    if (self.contactPickerViewHeightConstraint.constant > contactPicker.currentContentHeight)
    {
    [UIView animateWithDuration:contactPicker.animationSpeed animations:^{
    self.contactPickerViewHeightConstraint.constant = contactPicker.currentContentHeight;
    [self.view layoutIfNeeded];
    }];
    }
    }

// This delegate method is invoked to allow the parent to increase the size of the
// collectionview that shows which contacts have been selected. To increase or decrease
// the number of rows visible, change the maxVisibleRows property of the MBContactPicker

  • (void)contactPicker:(MBContactPicker*)contactPicker didUpdateContentHeightTo:(CGFloat)newHeight
    {
    self.contactPickerViewHeightConstraint.constant = newHeight;
    [UIView animateWithDuration:contactPicker.animationSpeed animations:^{
    [self.view layoutIfNeeded];
    }];
    }

@ChrisMcEwan
Copy link

Same issue, IOS 7.1 simulator (and on real device) with two contact pickers, contactpicker1is on top (higher up the view hierarchy) and works when clicked, but the selection list is behind contactpicker2.

contactpicker2 does not respond to clicks at all. Both pickers are just placed on a UIView. Excuse the random colours it is only to show up the

layout issues. Thanks.

overlay_issue

@ChrisMcEwan
Copy link

I managed to get the drop list to sit on top now, but still struggling to get the second picker to respond.. some code on how I initialise them, which works in iOS 7 but not 7.1 or above. Anybody able to advise on what is wrong ?

 // Contact Picker View CC
self.contactPickerViewCC.delegate = self;
self.contactPickerViewCC.datasource = self;
self.contactPickerViewCC.translatesAutoresizingMaskIntoConstraints = true;
self.contactPickerViewCC.prompt = @"CC:";


// Contact Picker View TO
self.contactPickerViewTO.delegate = self;
self.contactPickerViewTO.datasource = self;
self.contactPickerViewTO.translatesAutoresizingMaskIntoConstraints = true;
self.contactPickerViewTO.prompt = @"To:";

@ChrisMcEwan
Copy link

I've edited the sample to show the problem. Still working on this myself but not having much luck. Anybody able to assist ?

http://www43.zippyshare.com/v/63383352/file.html

@ghost
Copy link

ghost commented Mar 14, 2015

I'm having this issue on iOS 8. Any updates? I have three contact pickers (to/cc/bcc) and just the first one responds to clicks. I was able to change using becomeFirstResponder() and write something, but the cursor doesn't appear.

@ghost
Copy link

ghost commented Mar 17, 2015

I fixed this issue removing the contact pickers from the storyboard and including programmatically (w/ Masonry) as subview of the root view (viewcontroller.view).

If I include the contact picker inside other view, it doesn't work.

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

No branches or pull requests

5 participants