we found a way to do it via the UITextView based on various notes online
on the UITextView:
.allowsEditingTextAttributes = YES;
(the above allows memoji to show in keyboard ; note that
the user must have memoji switch on in his Settings/General/Keyboard)
// subclass UITextView and override the paste: function (or modify the paste: function if you have it)
// this is objC , swifties can figure out the swift
// this handles memoji as image; there are rumors that you can get it as GIF but we havent tried that yet
- (void)paste:(id)sender
{
// handle memoji still image selection which results in a paste
UIImage *image = [[UIPasteboard generalPasteboard] image];
// you can use this image do put into a UIImageView or do whatever you want with it
// here we take it and put it in the UITextView
if (image) {
NSTextAttachment *textAttachment = [[NSTextAttachment alloc] init];
textAttachment.image = image;
NSAttributedString *string = [NSAttributedString attributedStringWithAttachment:textAttachment];
[self setAttributedText:string];
}
else {
// do ordinary paste stuff for regular text paste
[super paste:sender];
}
}
Topic:
App & System Services
SubTopic:
General
Tags: