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

Recent Emojis #7

Open
hidoon opened this issue Apr 2, 2023 · 7 comments
Open

Recent Emojis #7

hidoon opened this issue Apr 2, 2023 · 7 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@hidoon
Copy link

hidoon commented Apr 2, 2023

Will there be recent emojis category?

@Finalet
Copy link
Owner

Finalet commented Apr 2, 2023

In a hypothetical future when all starts align.

For now though, you can extend functionality your self with emojiPicker(_: loadEmojiSections : withConfiguration : withLocalization) to insert your own recent emojis category.

@Finalet Finalet added enhancement New feature or request good first issue Good for newcomers labels Apr 2, 2023
@hidoon
Copy link
Author

hidoon commented Apr 2, 2023

It seems like loadEmojiSections replaces all other emojis. I wish I was able to just add another category section. Thanks so much for reply btw.

@Finalet
Copy link
Owner

Finalet commented Apr 2, 2023

You can get all emojis with ElegantEmojiPicker.getAllEmoji(), but they will not be sorted into categories.

For now, you can fork the repo and modify the private setupEmojiSections(config: ElegantConfiguration, localization: ElegantLocalization) method to insert your recent emoji section.

Its a good idea for me to make it public. Thanks.

@hidoon
Copy link
Author

hidoon commented Apr 2, 2023

I forked and changed the code as you said. Thanks a lot!

image

@Finalet
Copy link
Owner

Finalet commented Apr 2, 2023

Great! I'll make methods public later so you could do this natively.

@Finalet
Copy link
Owner

Finalet commented Apr 4, 2023

getDefaultEmojiSections() is now public, so you can append your section natively like so:

func emojiPicker(_ picker: ElegantEmojiPicker, loadEmojiSections withConfiguration: ElegantConfiguration, _ withLocalization: ElegantLocalization) -> [EmojiSection] {
    let allEmojis = ElegantEmojiPicker.getAllEmoji()
    
    let politeEmojis = allEmojis.filter({
        $0.emoji == "🖕" ||
        $0.emoji == "👊" ||
        $0.emoji == "🤬"
    })
    
    return [EmojiSection(title: "Politeness", icon: UIImage(systemName: "heart"), emojis: politeEmojis)] + ElegantEmojiPicker.getDefaultEmojiSections(config: withConfiguration, localization: withLocalization)
}

@hidoon
Copy link
Author

hidoon commented Apr 4, 2023

Thanks so much for your responsive behaviour 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants