Cleanup
This commit is contained in:
parent
b2ff1d0a0b
commit
406ac2a270
|
@ -116,7 +116,10 @@ final class EmojiPickerViewController: UIViewController {
|
||||||
searchBar.searchBarStyle = .minimal
|
searchBar.searchBarStyle = .minimal
|
||||||
searchBar.placeholder = NSLocalizedString("emoji.search", comment: "")
|
searchBar.placeholder = NSLocalizedString("emoji.search", comment: "")
|
||||||
searchBar.searchTextField.addAction(
|
searchBar.searchTextField.addAction(
|
||||||
UIAction { [weak self] _ in self?.viewModel.query = self?.searchBar.text ?? "" },
|
UIAction { [weak self] _ in
|
||||||
|
self?.viewModel.query = self?.searchBar.text ?? ""
|
||||||
|
self?.collectionView.setContentOffset(.zero, animated: false)
|
||||||
|
},
|
||||||
for: .editingChanged)
|
for: .editingChanged)
|
||||||
|
|
||||||
view.addSubview(skinToneButton)
|
view.addSubview(skinToneButton)
|
||||||
|
|
|
@ -34,10 +34,14 @@ final public class EmojiPickerViewModel: ObservableObject {
|
||||||
.assign(to: &$systemEmoji)
|
.assign(to: &$systemEmoji)
|
||||||
|
|
||||||
emojiPickerService.emojiUses(limit: Self.frequentlyUsedLimit)
|
emojiPickerService.emojiUses(limit: Self.frequentlyUsedLimit)
|
||||||
|
.receive(on: DispatchQueue.main)
|
||||||
.assignErrorsToAlertItem(to: \.alertItem, on: self)
|
.assignErrorsToAlertItem(to: \.alertItem, on: self)
|
||||||
.print()
|
|
||||||
.assign(to: &$emojiUses)
|
.assign(to: &$emojiUses)
|
||||||
|
|
||||||
|
$locale.removeDuplicates().flatMap(emojiPickerService.systemEmojiAnnotationsAndTagsPublisher(locale:))
|
||||||
|
.replaceError(with: [:])
|
||||||
|
.assign(to: &$systemEmojiAnnotationsAndTags)
|
||||||
|
|
||||||
$customEmoji.dropFirst().combineLatest(
|
$customEmoji.dropFirst().combineLatest(
|
||||||
$systemEmoji.dropFirst(),
|
$systemEmoji.dropFirst(),
|
||||||
$query,
|
$query,
|
||||||
|
@ -71,10 +75,6 @@ final public class EmojiPickerViewModel: ObservableObject {
|
||||||
return emojis.filter { !$0.value.isEmpty }
|
return emojis.filter { !$0.value.isEmpty }
|
||||||
}
|
}
|
||||||
.assign(to: &$emoji)
|
.assign(to: &$emoji)
|
||||||
|
|
||||||
$locale.removeDuplicates().flatMap(emojiPickerService.systemEmojiAnnotationsAndTagsPublisher(locale:))
|
|
||||||
.replaceError(with: [:])
|
|
||||||
.assign(to: &$systemEmojiAnnotationsAndTags)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue