ayushgoel / AGEmojiKeyboard

Emoji Keyboard for iOS
MIT License
692 stars 175 forks source link

DEFAULT_SELECTED_SEGMENT does not actually change the category content just the initially highlighted tab. #2

Closed nickthedude closed 10 years ago

nickthedude commented 10 years ago

I'm seeing if I can find a fix

nickthedude commented 10 years ago

As a workaround I'm populating the recents list manually using something like this:

  [self.emojiKeyboardView setInRecentsEmoji:@"<emoji>"];
yimingtang commented 10 years ago

Actually, you may set the category property in - (void)initWithFrame:(CGRect)frame.

For example:


- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // initialize category
        self.category = "People"; // Set the initial category name
        // Other code
    }
    return self;
}

A better solution is to add an initialCategory property which allows more flexible usages.

ayushgoel commented 10 years ago

The issue was that changing the macro value DEFAULT_SELECTED_SEGMENT wasn't chaining the selected category during initialisation. Please check the commit https://github.com/ayushgoel/iOS-emoji-keyboard/commit/7a48ec086336f85029328cf8800a49f35e6d1879 I am closing the issue for now. If anyone faces any issue on this again, please reopen it. :smile: